Inserting code for a opt-in box

Hello,

I’m trying to install an opt in bar at the top of my home page like a ‘Hello Bar’ and I’ve inserted the code into the Global CSS but it doesn’t work.

It is recommended that I insert the code before the closing code which I did on the individual home page under the ‘Page Settings’ in the ‘Body CSS Class’ line and that it doesn’t work. This is the code I need to insert,

Where is the appropriate place to insert this code on my page at www.rhodestostrength.com? Leadpages support was unable to help me.

Thank you!

Hi Candace,

Thank you for writing in, please remove that code from Theme Options > CSS and other CSS areas where you added it because that script is not a CSS.

Two ways to integrate that script to your site. first with a child theme, this allows you to make code changes that won’t be overwritten when an X update is released.

After you set up a child them add the following code in your child theme’s functions.php file:

/*Insert opt-in box*/
function my_custom_script(){
  ?>
    <script src="//static.leadpages.net/leadbars/current/embed.js" data-bar="YUStnndfKyyPAzF9vxYeyR" data-bar-domain="rhodestostrength.lpages.co" async defer></script>
  <?php
}

add_action( 'wp_footer', 'my_custom_script', 10 );

The second option is much easier, install this plugin activate it, then navigate to Settings > Insert Headers and Footers and paste your code in the Scripts in Footer box.

Hope it helps,
Cheers!

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