Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #848017

    Is there a way around editing the php files and have access to the source code? Need to paste some tracking code (from Facebook ads) into the <header> of some of our pages.

    #848064

    Hi,

    If you go to appearance>editor you get a list of all theme and child php files.

    You can use a php function to add your tracking script to certain page by editing the header.php.

    Hope that helps a little

    TJ

    #848122

    Thanks TJ, that does help though I’m honestly not very familiar with php, more with html/xml. Will look into your proposed solution.

    #848123

    Hi,

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

    function my_custom_code_head(){
    ?> 
    //Your code goes here
    <?php
    }
    add_action('wp_head', 'my_custom_code_head');

    Best regards,
    Yigit

    #848132

    Hi,

    I use this php to add tracking code straight in the header of certain pages. this code needs to be in the header.php before the </head> tag

    <?php if (is_page(xxx)) { ?>   
    <script>
    //tracking code here
    </script>
      <?php } ?>

    changing the xxx for the page id number.

    Do be careful when changing php files as mistakes can crash your site. You’ll then need ftp access to get in and remove the changes.

    Thanks

    TJ

    #848144

    Hi!

    Thanks for your input TJ! :)

    Regards,
    Yigit

    #848485

    Thanks TJ and Yigit,

    Very helpful input indeed and yes, we will be careful!

    #848522

    Hi,

    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 :)

    Best regards,
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Accessing source code to edit’ is closed to new replies.