Ok after a long search here is what I have done, it is almost working but I got a little problem remaining
- I have activated the CSS Classes for my menus
- I have added the class "logged-in-nav" to the menu I want it to be displayed only for logged users
- I have created and activated a child theme for dejavu (dejavu-child)
- I have added this ▼ to a child theme /wp-content/themes/dejavu-child/style.css
/*
Theme Name: Dejavu-Child
Theme URI: http://mysitemyway.com/
Description: Child Theme for DejaVu From A Mysitemyway Premium Wordpress Theme
Author: Mysitemyway
Author URI: http://mysitemyway.com/
Template: dejavu
Version: 1.3
*/
@import url("../dejavu/style.css");
li.logged-in-nav
{
display: none;
}
body.logged-in li.logged-in-nav
{
display: list-item;
}
- I have added this ▼ to /wp-content/themes/dejavu-child/function.php
<?php
// Add specific CSS class by filter
add_filter('body_class','nec_logged_in_filter');
function nec_logged_in_filter($classes)
{
if( is_user_logged_in() )
{
$classes[] = 'logged-in';
}
// return the $classes array
return $classes;
}
?>
when I add the CSS class 'logged-in' manually to the body class attribute I can activate or deactivate menus with the "logged-in-nav" class but the problem here is that the nec_logged_in_filter function doesn't seems to be called by the body_class filter, or if it is, it doesn't add 'logged-in' to classes array, or if it is then it is cleared later. :/