[Resolved] Sticky menu not working and lot of errors when loading the Customizer

Home Forums Support [Resolved] Sticky menu not working and lot of errors when loading the Customizer

Home Forums Support Sticky menu not working and lot of errors when loading the Customizer

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1671285
    Annamari

    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

    #1671712
    David
    Staff
    Customer Support

    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 ?

    #1671798
    Annamari

    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

    #1671901
    David
    Staff
    Customer Support

    Can you temporarily disable the Elements Module to check if any codes using a Hook element is conflicting ?

    #1671920
    Annamari

    Great idea, David. It’s something in the Elements. When I disabled it, the sticky menu started to work too.
    Thanks!

    #1671921
    Annamari

    It’s the Facebook pixel code. :O

    #1671935
    David
    Staff
    Customer Support

    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 )

    #1671961
    Annamari

    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!

    #1672035
    David
    Staff
    Customer Support
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.