Below is the code to force the primary navigation menu to one level depth in Genesis.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
Below is the code to force the secondary navigation menu to one level depth in Genesis.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |