
By default, when the blog admin left a comment on his blog, WordPress use the name in the comment css class. This is useful for styling, but it will also let people know about your admin login name. If you want to hide this info, read this recipe.

By default, when the blog admin left a comment on his blog, WordPress use the name in the comment css class. This is useful for styling, but it will also let people know about your admin login name. If you want to hide this info, read this recipe.
This code simply have to be pasted in your functions.php file to work:
function remove_comment_author_class( $classes ) {
foreach( $classes as $key => $class ) {
if(strstr($class, "comment-author-")) {
unset( $classes[$key] );
}
}
return $classes;
}
add_filter( 'comment_class' , 'remove_comment_author_class' );
Thanks to C. Bavota for this interesting piece of code!
4 Responses
It’s used to style admin comment with defferent colour.
You can actually use the .bypostauthor classname to style the comments left by the post’s author.
Good code, nice looking and useful. Thanks to c.bavota for it.
One good reason to protect one more time my blogz.
This code simply have to be pasted in your functions.php file to work:
I am a beginner – where can I find functions.pp file??
Thanks
Alex
Trackbacks: