I wanted to hide the add to favorites buttons and the save search buttons for logged out users. But maybe other people using GD want other elements to show or hide when someone is logged in or logged out. For those interested there is a fast way to make any element hide or show when a user is logged in or logged out.
Add this to your code-snippets or functions.php:
add_filter('body_class','er_logged_in_filter');
function er_logged_in_filter($classes) {
if( is_user_logged_in() ) {
$classes[] = 'logged-in-condition';
} else {
$classes[] = 'logged-out-condition';
}
// return the $classes array
return $classes;
}
Then add the following to your custom css:
.logged-out-condition .hide-logged-out {
display: none!important;
}
.logged-in-condition .hide-logged-in {
display: none!important;
}
Now if you want to hide something for not logged in users you can use .hide-logged-out
If you want to hide something for logged in users you can use .hide-logged-in
I know that GD also has a visibility condition you can set, but that is not shown everywhere. With this code you can add .hide-logged-in or .hide-logged-out as a custom CSS class to hide or show things.