Skip to content

Instantly share code, notes, and snippets.

@aslamahamed13
Last active May 22, 2020 07:58
Show Gist options
  • Save aslamahamed13/200af837ae43fc4dd330ac3f93a8b99e to your computer and use it in GitHub Desktop.
Save aslamahamed13/200af837ae43fc4dd330ac3f93a8b99e to your computer and use it in GitHub Desktop.
add_filter('body_class','er_logged_in_filter');
function er_logged_in_filter($classes) {
if( is_user_logged_in() ) {
$classes[] = 'loggedin-class';
} else {
$classes[] = 'loggedout-class';
}
return $classes;
}
.loggedout-class.post-284267 .entry-content {
padding: 0.75rem 1.25rem;
border: 1px solid transparent;
border-radius: 0.25rem;
color: #004085;
background-color: #cce5ff;
border-color: #b8daff;
}
.loggedout-class.page-id-288728 .entry-content {
padding: 0.75rem 1.25rem;
border: 1px solid transparent;
border-radius: 0.25rem;
color: #004085;
background-color: #cce5ff;
border-color: #b8daff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment