• Hi, we’re having a problem with the mobile menu on our site. It’s a child theme for Vega.

    When you click on the hamburger to open the mobile menu, it flashes open for a moment and then promptly closes again. We’re just using the default menu for the theme.

    I am not seeing any errors in the browser console that would explain this behavior. Is this something you have seen before? Apparently it’s not new behavior, but my users just informed me of it.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @vmiluk,

    Thanks for getting in touch about this.

    It’s tough to say for sure without being able to debug, but it looks like you have Bootstrap being included twice- an old version and a new version. I would make sure only the new version is being loaded (the one Vega uses), and see if that does the trick.

    Currently it’s adding the wrong class to the menu when opened, which is most likely the issue.

    Hope this helps, let us know how it goes!

    Thread Starter vmiluk

    (@vmiluk)

    Thanks for responding!

    My functions.php file has this, and I think I got the entire file from this forum.

    add_action( 'wp_enqueue_scripts', 'vega_child_enqueue_styles' );
    function vega_child_enqueue_styles() {
        
        $parent_style = 'vega-wp-style';
        $deps = array('bootstrap', 'font-awesome', 'bootstrap-social');
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' , $deps);
        
        $vega_wp_color_stylesheet = vega_wp_get_option('vega_wp_color_stylesheet');
        wp_enqueue_style('vega-wp-color', get_template_directory_uri() . '/color-schemes/' . strtolower($vega_wp_color_stylesheet) . '.css', array() );
        
        wp_enqueue_style( 'vega-wp-style-child',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style, 'vega-wp-color' ),
            wp_get_theme()->get('Version')
        );
    }

    If I remove bootstrap from this, then the entire menu breaks. I’m not sure what I’m missing (it makes sense though, what you’re saying) or how it would need to be modified to not include Bootstrap twice.

    Thanks- this looks good, I think it may be a plugin including an old version. Are you using an accordion plugin? If so, could you try disabling it to see if that solves the problem?

    Thread Starter vmiluk

    (@vmiluk)

    That was the culprit! That’s annoying. Do you know of any accordion plugins that don’t cause this issue with the Vega theme? I’m happy to propose a change to the users if you do.

    Glad to hear that! I haven’t tried any personally, but you should be safe with any that aren’t forcing an older version of Bootstrap. Or if you liked what you currently had, you could check with the plugin author to see if they have either an update in the works or possibly a setting to disable the additional Bootstrap load.

    Best of luck!

    Thread Starter vmiluk

    (@vmiluk)

    I’ll give that a try. Thanks so much for helping!

    Anytime! Take care! 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Mobile menu not staying open’ is closed to new replies.