Tagged: main-menu
Hello,
How can I assign Main Menu #1 to Pages/Articles and Main Menu #2 to Portfolio items?
Best regards
Oriano
Hey Oriano,
Thanks for contacting us!
Please refer to this post – https://kriesi.at/documentation/enfold/menu/#different-menu-for-different-pages
You can use the code as following and change menu names :)
function my_custom_wp_nav_menu_args( $args = '' ) {
if($args['theme_location'] === 'avia')
if( is_singular( 'portfolio' ) ) {
$args['menu'] = 'Anchor Menu';
} else {
$args['menu'] = 'Full Menu';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_custom_wp_nav_menu_args' );
Best regards,
Yigit
yes – but do not forget to add the filter:
function my_custom_wp_nav_menu_args( $args = '' ) {
if($args['theme_location'] === 'avia')
if( is_singular( 'portfolio' ) ) {
$args['menu'] = 'Anchor Menu';
} else {
$args['menu'] = 'Full Menu';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_custom_wp_nav_menu_args' );
Hi,
Exactly! Thanks a lot @guenni007! I tested it on my local installation before posting and apparently forgot to copy a very important line :) I edited my post as well
Best regards,
Yigit
Thanks Yigit, thanks Guenni007, for your help.
I am testing in the MAMP local version of the site.
Best regards
Oriano