Created
September 22, 2011 16:41
-
-
Save BjornW/1235290 to your computer and use it in GitHub Desktop.
remkus-edited
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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