Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #984906

    Hi there. I use an enfold child theme and need to install code for the Facebook pixel into the theme’s header php. I’ve read so many support posts on this but not tell you how to copy the primary theme’s header over to the child theme. I’ve also seen a lot of people complaining about how it doesn’t work when they try the suggestions. Do you have any easy instructions for copying the main theme’s header php over to the child theme? I have no idea how to do this.

    Thank you,
    Jo Lynn Deal

    #985022

    Hey jolynndeal,

    You don’t need to copy header.php to your child theme. Please try this in your functions.php file instead:

    function jo_lynn_add_fb_pixel(){ ?>
    REPLACE THIS TEXT WITH YOUR FB PIXEL CODE
    <?php }
    add_action('wp_head', 'jo_lynn_add_fb_pixel');

    Best regards,
    Rikard

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