Facebook Messenger | How To Add Code To XPRO Theme

Hello,

I am trying to add the FB Messenger tool to my website. I can not figure out how to add my code "After the opening body tag. Below is exactly what FB is demanding.

“Insert it directly after the opening tag on each page where you want the plugin to appear.”

I believe I need to copy this into my Header.php file, but that doesnt seem to be the correct place for me to insert the code for Xpro.

I am using Ethos & Im on Xpro, with a Child Theme.
My website is https://freemandigitalcompany.com/

Really could use some help. Thanks

Hi There,

Thank you for writing in, please add the custom function below (with the fb code) on your child theme’s functions.php file instead.

add_action('x_before_site_begin','fb_messenger');
function fb_messenger () { ?>

<!-- Replace this line with your actual FB code -->

<?php }

Hope it helps,
Cheers!

1 Like

That worked! Thank you so much.

You’re welcome, we are delighted to assist you with this.

Cheers!

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