Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reduce navigation menu to one level depth in Genesis. Source: StudioPress Generate Pro child theme
<?php
//* Reduce the primary navigation menu to one level depth
add_filter( 'wp_nav_menu_args', 'prefix_generate_primary_menu_args' );
function prefix_generate_primary_menu_args( $args ){
if( 'primary' != $args['theme_location'] )
return $args;
$args['depth'] = 1;
return $args;
}
<?php
//* Reduce the secondary navigation menu to one level depth
add_filter( 'wp_nav_menu_args', 'prefix_generate_secondary_menu_args' );
function prefix_generate_secondary_menu_args( $args ){
if( 'secondary' != $args['theme_location'] )
return $args;
$args['depth'] = 1;
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.