Search for answers:
The OptimizePress Support Site Has Moved: Click here to access the new Support site

OverlayOptimizer Broken when using WordPress 4.5

If you are experiencing issues with the OverlayOptimizer not opening after updating your site, this might be due to some custom code you have inside Page Settings > Other Scripts > Header/Footer sections 

Some pages include a Javascript which was added for smooth scrolling, these have been found to break some other page elements in the latest WordPress 4.5 

To fix this, we advise replacing the code with the fixed code (see steps below):

Step 1...

Look for this code (usually found within Page Settings > Other Scripts > Footer

<script>
opjq(function($) {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>

 

Step 2...

and Replace with this code:

<script>
opjq(function($) {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>

 

You can download a fixed version of the Long Form Landing Page template which includes this feature from the link below. 

Didn't find an answer to your question? Contact Our Support Team (Submit a ticket)
Was this article helpful?
1 out of 1 found this helpful
Follow

Comments

Other Help Categories:

Get Started Guide

Watch our Ultimate Getting Started guide video

Pre-Sales Questions

Ask questions before purchasing our products

Login Problems

If you're having issues logging into our members hub

Accounts & Billing

Update your billing, request a refund and other accounts help

API Key Issues

Get help with licensing your site and API key issues

Membership Help

Get help creating Membership portals and courses

LiveEditor Help

If you need help using or troubleshooting the LiveEditor

Integrations

Find out about the many integrations possible with OptimizePress

Affiliate Questions

Have questions about promoting OptimizePress

Clubhouse Questions

Questions about our Clubhouse Membership Subscription