Created
October 24, 2014 22:39
-
-
Save Manoz/f6c65f7b20430424639f to your computer and use it in GitHub Desktop.
WordPress: check if the comment author is the post author.
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
<?php | |
/** | |
* By default, WordPress add a .bypostauthor class on comments | |
* I prefer echo something to have a better control in CSS. | |
* Exemple: http://codepen.io/Creaticode/full/ijExL | |
*/ | |
global $post; | |
if ( $comment->user_id === $post->post_author ) { | |
echo '<span class="is-author">Author</span>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment