Archived topic
Sticky menu not working and lot of errors when loading the Customizer
8 replies · Started by Annamari on February 24, 2021
Hi,
I have a problem with the sticky menu: it won't work even when switched on.
When I load the Customizer, I can see a lot of error messages in the Console:
Uncaught ReferenceError: _ is not defined
at wp-util.min.js:2
at wp-util.min.js:2
backbone.min.js:2 Uncaught TypeError: Cannot read property 'extend' of undefined
at backbone.min.js:2
at backbone.min.js:2
at backbone.min.js:2
wp-playlist.min.js:1 Uncaught ReferenceError: _ is not defined
at wp-playlist.min.js:1
customize-selective-refresh.min.js:2 Uncaught TypeError: Cannot read property 'Value' of undefined
at customize-selective-refresh.min.js:2
at customize-selective-refresh.min.js:2
customize-preview-widgets.min.js:2 Uncaught ReferenceError: _ is not defined
at customize-preview-widgets.min.js:2
customize-preview-nav-menus.min.js:2 Uncaught ReferenceError: _ is not defined
at customize-preview-nav-menus.min.js:2
I tried disabling the plugins but see no improvement.
Thanks for any help,
Annamari
Hi there,
we may need admin access to see what is 'breaking' the customizer but what i notice on the Front End is the Testimonial Slider is not working and throwing a javascript error. One JS error can cause all subsequent scripts to not work correctly.
Could you test the site without the slider in place ?
Hi David, thanks for your reply.
I can see the slider working on the front page... and if I switch it off, I still see the error messages in the customizer too. :(
I'm sending you the admin access below.
Thank you,
Annamari
Can you temporarily disable the Elements Module to check if any codes using a Hook element is conflicting ?
Great idea, David. It's something in the Elements. When I disabled it, the sticky menu started to work too.
Thanks!
It's the Facebook pixel code. :O
Oh thats not one i would have guessed. You can try adding this PHP Snippet to stop that hook callback from running in the Customizer:
add_filter( 'generate_hook_element_display', function( $display, $element_id ) {
if ( 10 === $element_id && is_customize_preview() ) {
$display = false;
}
return $display;
}, 10, 2 );
The 10 needs to be changed to the Hook Elements ID ( you can find that in the browser URL when editing the Hook ID=XXX )
I'll figure out how to do this because this is what stops the sticky menu from working too, so it's not enough to stop running the code in the customizer.
Thanks for your help, David!
You're welcome!