Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #733368

    Have a client that sent us over stand alone .php pages for a 5 part form that needs verification along the way as it is filled out (we are reconstructing these pages in a new WP site for them). I am trying to find out how we can add the following code below to the header area above </head>. Plugins we have tried do not do the job. Any advice on the best way to do this for specific pages is much appreciated (there is different code for all 5 pages in the head area):

    <?php

    include_once __DIR__.’/FX/FX.php’;
    include_once __DIR__.’/FX/FX_Error.php’;
    include_once __DIR__.’/FX/server_data.php’;
    require_once __DIR__.’/FX/image_proxy.php’;

    // suppress PHP notices
    ini_set(‘display_errors’,’Off’);

    $vendorName=$_POST[“vendorName”];
    $billingCode=$_POST[“billingCode”];
    $reportEmail=$_POST[“reportEmail”];

    $fullName=$_POST[“fullName”];
    $address=$_POST[“address”];
    $address2=$_POST[“address2”];
    $city=$_POST[“city”];
    $state=$_POST[“state”];
    $zipCode=$_POST[“zipCode”];
    $phone=$_POST[“phone”];
    $altPhone=$_POST[“altPhone”];
    $email=$_POST[“email”];

    $successFlag=TRUE;
    if (is_object($search1Result)) {
    if ($search1Result->code == 401) {
    //echo ‘isObject_401(‘.$search1Result->code.’)’;
    $successFlag=FALSE;
    }
    } else if ($search1Result[‘errorCode’] == 401) {
    //echo ‘notAnObject_401(‘.$search1Result[‘errorCode’].’)’;
    $successFlag=FALSE;
    } else {
    //echo ‘passedBoth401Tests(‘.$search1Result[‘errorCode’].’)’;
    }

    // Pull the ContractorID
    foreach($search1Result[‘data’] as $key=>$search1Data) {
    $contractorID=$search1Data[‘id’][0];
    }

    ?>

    #734304

    Hey!

    Please try adding following code to Functions.php file in Appearance > Editor

    function my_custom_code(){
    if(is_page(59)){
    //Your code goes here
    }
    }
    add_action('wp_head', 'my_custom_code');

    and change page ID (“59” in the example)

    Best regards,
    Yigit

    #736122

    Exactly what we needed, Yigit…thanks for your help!

    #736124

    Hey!

    You are welcome! :)

    For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
    And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
    For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)

    Cheers!
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Need to add php code to speicfic pages’ is closed to new replies.