Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress author check.
<?php if(get_the_author() == 'admin') {
echo 'admin';
} else {
comments_template();
} ?>
@johnbhartley

This comment has been minimized.

Copy link
Owner Author

johnbhartley commented Jan 14, 2013

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
You can’t perform that action at this time.