Adding a sticky bar to pages

Hello,

I am having a bit of an issue. I want to insert a sticky bar to the top of my all pages that features a sale. I am using unbounce and they gave me a script to insert:

<script><src="https://3e87961615b74636a0cc55b897b051b8.js.ubembed.com" async></script>

I am having a heck of a time getting it installed. I inserted it in the header section as directed, but it says but it’s not activating. Any help would be good.

I put the code in my insert header and footer plugin. It is showing up in the code. I just don’t see it actually activating or showing on the website.

I also tried inserting some code in the child theme, and other plugins etc. I just can’t figure it out.

Hello @rfbarr ,

Can you double check that code? It seems incorrect and throwing syntax error. Maybe it should be like this:

<script src="https://3e87961615b74636a0cc55b897b051b8.js.ubembed.com" async></script>

Try adding the code instead inside RAW content element.

Hope this helps.

Thanks! Okay I added that

<script src="https://3e87961615b74636a0cc55b897b051b8.js.ubembed.com" async></script>

Okay I have it on the page now! Yay!

Is there a way to make it global across the domain instead of inserting it into a content block on every page?

Hi @rfbarr,

Yes, it’s possible. Please setup a child theme first:

After that add the following code under functions.php file locates in your child theme:

add_action('x_before_site_begin', 'x_print_sticky_bar');
function x_print_sticky_bar(){
	?>
	<script src="https://3e87961615b74636a0cc55b897b051b8.js.ubembed.com" async></script>
	<?php
}

Hope it helps :slight_smile:

I did this but I don’t think it worked.

Its FloatRubicon.com

Hello @rfbarr,

After making the changes and doing the updates, always remember to clear all caches (if you are using WP Rocket, WP SuperCache or W3 Total Cache) when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.

And please clear your browser cache too. You may use private browsing mode in testing your site to make sure that you are viewing the latest codes from the updates and not the cached version in your browser.

If this does not work, please provide us access to site by adding the login credentials in your next reply. To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Regards.

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