-
AuthorPosts
-
August 21, 2018 at 5:44 pm #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!
August 21, 2018 at 6:49 pm #999925Hey 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 ShannonAugust 22, 2018 at 8:01 am #1000151So log into FTP and copy/paste header.php folder into the root of the child theme, and that’s it?
August 22, 2018 at 11:49 am #1000238Hi,
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,
RikardAugust 28, 2018 at 11:37 pm #1002914Can 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.
August 29, 2018 at 6:56 am #1003002Hi 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,
RikardAugust 29, 2018 at 6:09 pm #1003231That did it thanks!
August 30, 2018 at 6:48 am #1003383November 17, 2020 at 10:38 pm #1261137Hi 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’);
ThanksNovember 17, 2020 at 10:42 pm #1261140This reply has been marked as private.November 17, 2020 at 11:14 pm #1261154Hi ppi37,
Is this working for you or do you need help with this code?
Best regards,
VictoriaNovember 17, 2020 at 11:23 pm #1261155Hi 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 ?
ThanksNovember 19, 2020 at 4:35 am #1261442Hi 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,
RikardNovember 21, 2020 at 11:40 am #1261910Hi Enfold team,
Yes it seems to work fine.
ThanksNovember 21, 2020 at 10:26 pm #1262022Hi ppi37,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.