Remove Dropdown

Hey Comminty,

i search for a way to remove the dropdown-mode in the main-nav. I use stricktly the plugin nested pages for site-structure, so it arrange subpages to parentpages.

But i want in desktop-view remove the dropdown, want only the parent-pages. Give it a solution with beans to reduce the nav-depth, or can i hide the dropdown only in less?

best regards Marcus

Hi Marcus,

I'd use the standard wp_nav_menu_args filter from WP Core to set the depth:

add_filter( 'wp_nav_menu_args', function( $args ) {
        if ( 'primary' !== $args['theme_location'] ) {
            return $args;
        $args['depth'] = 1;
        return $args;

You'd probably want to remove the dropdown indicator with beans_remove_markup('beans_menu_item_child_indicator[_***]');

Replace the *** with the value in your markup.

Hi Christoph,

tank you. i had the same idea first, but it kills also the second level in the mobile Menu... it is show above 960px site-width. This is my problem.

You could try installing Mobble and using one of the conditionals (e.g. is_handheld() ) Other than that, CSS/Less would be the way to go.

Write a reply

Login or register to write a reply, it's free!