Skip to content

Instantly share code, notes, and snippets.

@wpspeak
Forked from cdils/conditionalcomments.php
Created June 16, 2013 16:19
Show Gist options
  • Save wpspeak/5792520 to your computer and use it in GitHub Desktop.
Save wpspeak/5792520 to your computer and use it in GitHub Desktop.
// Remove comments from posts
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );
// Add comments back in if conditions are met
add_action( 'genesis_after_post', 'cd_conditional_comments' );
function cd_conditional_comments() {
// Conditional Reference http://codex.wordpress.org/Function_Reference/get_the_author
if ('Author Display Name' == get_the_author() ) {
genesis_get_comments_template();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment