Conflict between Facebook pixel and slider

I’ve tried to add my facebook pixel code to the function.php file in my pro child theme.
whenever I add the code the top part of my header and slider disappear.

what can i do?

Hello @Leprojet251

Thanks for writing to us

In case if you want to install Facebook pixel code through child theme with the help of coding it would require custom development I would recommend you to contact a developer who can assist you with your concern.

Please note that we don’t provide custom development and child theme support. It is out of the support scope.

Regretfully, there is no option in the theme to add any custom code in the header. To add Facebook pixel code into your website you can have a look at this thread

You can also have a look at this article to learn more how to insert custom code in the site.

Hope it helps
Thanks for understanding

I don’t really understand. i used the plugin you recommended in your previous reply and my menu stops being stick is i put the pixel code at the end of the page. In the middle it hides the menu, at the top it disables the header and the slider.

This seems to be a serious issue. I think that Facebook pixel a common enough code that there should be an easy way to add it like GOOGLE code.

is there anything else you can recommend? Can you describe in a general way how I can add the code? I’ve tried plugin, function.php. Is my last resort to hard code in every page on my site?

Is the issue the Child theme? is the issue the X-theme? I’ve used other themes and have never come across this issue. if it can’t be resolved, I’ll have to switch theme and ask for a refund.

Can you help?

Hello @Leprojet251,

Adding the Facebook Pixel code in your child theme’s functions.php file requires the right code so that it will not create issues to other elements on the page. The easiest and effective way of adding the code is by way of using the Insert Header and Footer plugin. I have logged in to your site and I have checked your child theme. I did not found any code in there. Perhaps you have removed it already. I also noticed that you added a Header and Footer plugin. I could not find any Facebook Pixel code anywhere.

Please get the code and add it in the header by way of the plugin and your issue should be resolved. If nothing is helping, kindly post the code in your next reply so we can point you out where you can insert it or we can insert it for you.

Best Regards.

The code is in the secure note.

When I add the code anywhere in the available options it hides my header and or slider.

Hello @Leprojet251,

I am only seeing the WP credentials in the secure note and then this is what I see in your child theme’s functions.php file:

// Enqueue Parent Stylesheet
// =============================================================================

add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );



// Additional Functions
// =============================================================================
// Add scripts to wp_head()

Please provide the Facebook Pixel code in your next reply so we can check it and help you implement it to your site.

Cheers.

Hey @Leprojet251,

By withdrawing your post, we assume that you already have resolved your issue.

Thanks.

no its because I accidently posted the same thing twice

Hi @Leprojet251,

Can you please let us know if you are still having the issue if so please provide the Facebook pixel code as requested by my colleague or you can use the plugin Insert Headers and Footers to inject the code.

Thanks

Yes I am still having issues
Here is the code:

The code seems to disappear when I add it in the message. I’ve added it to a secure note

Hi @Leprojet251,

By going ahead, I have added the code in your child theme functions.php and the code is appearing on your website pages. The wp_footer action hook has been used to inject the code into the footer.

function fbpixel_script()
{
?>
    <!-- Facebook Pixel Code -->
    
    <!-- End Facebook Pixel Code —>
<?php 
}
add_action( 'wp_footer', 'fbpixel_script' );

Remember that the above code will work if copied as it is and don’t conflict with any existing style.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We do not provide support for custom codes that means we can’t fix it in case it conflicts with something on your site nor will we enhance it.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.