Site logo

Archived topic

Double secondary menu issue

26 replies · Started by Carsten on July 23, 2020

Viewing posts 16–27 of 27

Hi there,

You should just be able to do this:

.secondary-navigation .secondary-menu-toggle {
    display: none;
}

Hi there, yes, the css hides the secondary mobile menu, but I really would like to know, why this is happening after an update, and why it is necessary to add a code snippet to prevent the mobile menu to appear in the first place?

It depends on what version you updated to, and which update you came from. What version of GP and GP Premium are you using?

GeneratePress Version: 2.4.2 and Premium Version 1.11.0-alpha.4

I have updated, every time a new update has been available.

But my point is, why it is necessary to add this code snippet below, when creating a secondary menu?

Besides, it is not working, so should I just delete it?

add_action( 'wp_enqueue_scripts', 'generate_dequeue_secondary_nav_mobile', 999 );
function generate_dequeue_secondary_nav_mobile() {
    wp_dequeue_style( 'generate-secondary-nav-mobile' );
}

That function removes the mobile CSS file for the secondary navigation. That file no longer exists as of GPP 1.11.0 as we moved everything into one file, which explains why it stopped working.

I'll have to think about whether to undo that change or not before we enter beta testing.

Thanks!

That's fine, I just wanted to know what was going on, if it was an issue in my set up only, that the code was not working anymore.

Thanks

I just released alpha.5 which should correct this.

Thanks!

Hi there, thanks for letting me know. I updated the plugin, and deleted the code, but I'm still seeing two secondary menus on mobile. I have cleared the page cache, but I can't yet for sure rule out it's a cache issue.

I expect the update should work without this code:

.secondary-navigation .secondary-menu-toggle {
    display: none;
}

Is this function still active on your site?:

add_action( 'wp_enqueue_scripts', 'generate_dequeue_secondary_nav_mobile', 999 );
function generate_dequeue_secondary_nav_mobile() {
    wp_dequeue_style( 'generate-secondary-nav-mobile' );
}

I'm seeing that file loading, so the style isn't being dequeued.

No, I deleted that, I understood it was not needed anymore.

I will add the code later, and report back

I pasted the code snippet in, and the issue is solved.

Thanks!

No problem! Thanks for letting us know :)

This archived topic is closed to new replies.