Below is the code to force the primary navigation menu to one level depth in Genesis.
Below is the code to force the secondary navigation menu to one level depth in Genesis.
Below is the code to force the primary navigation menu to one level depth in Genesis.
<?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.
<?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; | |
} |