Skip to content

Instantly share code, notes, and snippets.

@johnbhartley
Created January 14, 2013 19:46
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 johnbhartley/4532746 to your computer and use it in GitHub Desktop.
Save johnbhartley/4532746 to your computer and use it in GitHub Desktop.
WordPress author check.
<?php if(get_the_author() == 'admin') {
echo 'admin';
} else {
comments_template();
} ?>
@johnbhartley
Copy link
Author

get_the_author() grabs the display name, set by the user, so if the display name for admin is JMoney, it would have to be == 'JMoney'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment