Skip to content

Instantly share code, notes, and snippets.

@BjornW
Created September 22, 2011 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BjornW/1235290 to your computer and use it in GitHub Desktop.
Save BjornW/1235290 to your computer and use it in GitHub Desktop.
remkus-edited
/**
* Adds a body class 'not-logged-in' for guests.
*
* We use this because X
*
* @author Remkus de Vries
* @link http://remkusdevries.com/when-sharing-wordpress-related-code-snippets-i-can-haz-standards-please/
* @param array $classes Existing body classes
* @return array Amended body classes
*/
if( ! function_exists('ft_add_guest_body_class') ) {
function ft_add_guest_body_class( $classes )
{
if ( ! is_user_logged_in() ) {
$classes[] = 'not-logged-in';
}
return $classes;
}
add_filter( 'body_class' , 'ft_add_guest_body_class' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment