I'm trying to find a way to add a body class "author" IF the current user is the author of the post they are viewing.
This is what I have so far...
add_filter( 'body_class','my_body_classes' );
function my_body_classes( $classes ) {
if ( !$current_user->ID == $post->post_author ) {
$classes[] = 'post-author';
}
return $classes;
}
if
expression. Comparison Operators