in template.php line 104
$body_classes[] = ($vars['logged_in']) ? 'logged-in' : 'not-logged-in';
is not working.
This body class is always set to 'not-logged-in'
This is probably because $vars['logged_in'] is not available by default.
we should set it manually before we can use it in $body_classes[]
should be something like:
global $user;
// An anonymous user has a user id of zero.
if ($user->uid > 0) {
// The user is logged in.
$vars['logged_in'] = TRUE;
}
else {
// The user has logged out.
$vars['logged_in'] = FALSE;
}
//before we can add it to body classes with:
$body_classes = array();
body_classes[] = ($vars['logged_in']) ? 'logged-in' : 'not-logged-in';
Comments
Comment #1
israelshmueli commentedTo be more specific:
Comment #2
tombigel commentedThanks
Added to 5.x dev, please check.