Hi,
I am using the Kleo theme and I have installed the plugin Nav Menu Role to be able to change the menu depending on whether one is logged in or logged out. It didn’t quite work as expected, so I tried a couple of other similar plugins with the same results :
– When logged out, the menu appears fine !
– When logged in, the menu does not appear at all (on every page set to “logged in”
Then I removed the plugin and tried to insert the following code in the function.php file :
function
my_wp_nav_menu_args(
$args
=
''
) {
if
( is_user_logged_in() ) {
$args
[
'menu'
] =
'logged-in'
;
}
else
{
$args
[
'menu'
] =
'logged-out'
;
}
return
$args
;
}
add_filter(
'wp_nav_menu_args'
,
'my_wp_nav_menu_args'
);
The result this time is that the menu appears twice instead of once.
Can you hep?
Thanks.