Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #999911

    Hello,

    I’m looking to add the facebook pixel tracking code to my site and it instructs me to add code to paste it between the header tags on every page of the site. I found this post which is helpful: https://kriesi.at/support/topic/add-code-to-header-tag/ but i’m not sure how to copy and paste the header and footer php files into my child theme so they do not get overwritten with updates. Can someone help? Thank you so much, love Enfold!

    #999925

    Hey bobfurgo,

    You can simply put the files in the root of your child theme. They will take precedence over the parent theme files and thus remain update proof.

    Best regards,
    Jordan Shannon

    #1000151

    So log into FTP and copy/paste header.php folder into the root of the child theme, and that’s it?

    #1000238

    Hi,

    Yes, but you will have to place the link to the code in header.php as well of course, if you post the code you need to add then we can give you a function to use in functions.php instead if you like.

    Best regards,
    Rikard

    #1002914

    Can someone give me a step by step on the above? I need to do this too and i don’t fully understand the above instructions.

    #1003002

    Hi strengthcoaching,

    Please try this in your child theme functions.php file:

    function strengthcoaching_add_fb_pixel(){
    ?>
    !YOUR FB PIXEL SCRIPT GOES HERE!
    <?php
    }
    add_action('wp_head', 'strengthcoaching_add_fb_pixel');

    Best regards,
    Rikard

    #1003231

    That did it thanks!

    #1003383

    Hi,

    Great, glad we could help :-)

    Best regards,
    Rikard

    #1261137

    Hi Rikard,
    to add a snap pixel in the enfold child theme,
    the code below is correct ? (I just replace fb by snap in the name of the function)
    function strengthcoaching_add_snap_pixel(){
    ?>
    !YOUR SNAP PIXEL SCRIPT GOES HERE!
    <?php
    }
    add_action(‘wp_head’, ‘strengthcoaching_add_snap_pixel’);
    Thanks

    #1261140
    This reply has been marked as private.
    #1261154

    Hi ppi37,

    Is this working for you or do you need help with this code?

    Best regards,
    Victoria

    #1261155

    Hi Victoria,
    My customer ask me to add the SNAP pixel.
    I don’t know how to verify if the code is OK.
    I’m going to look for it.
    My question is :
    does the code function is specific to fb pixel or I can use it with any pixel code ?
    Thanks

    #1261442

    Hi ppi37,

    The function you posted above should work in your functions.php file. You can verify that it works by inspecting the front end of your site, and search for this string for example: ad499256-efbd-4418-a052-4d5778fa1799

    Best regards,
    Rikard

    #1261910

    Hi Enfold team,
    Yes it seems to work fine.
    Thanks

    #1262022

    Hi ppi37,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.