Hey guys,
I am running this lovely snippet to change the main menu shown depending on if the visitor is logged in/out.
function wpc_wp_nav_menu_args( $args = '' ) {
if( is_user_logged_in() ) {
$args['menu'] = 'Subscriber';
} else {
$args['menu'] = 'Visitor';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'wpc_wp_nav_menu_args' );
The code works perfectly, however, I have just added a secondary navigation menu which also displays the main menu in place of the secondary menu, and this snippet is the culprit.
Could this snippet be amended, so it only targets the main menu, leaving the secondary menu in peace?
I have used the snippet you recommend here to hide the secondary nav when required.
Thanks,
Toby