Created
July 15, 2014 21:57
-
-
Save ChrisCree/e9535476bfb7b0779147 to your computer and use it in GitHub Desktop.
Remove comments from specific category posts in the Genesis theme framework.
This file contains hidden or 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 | |
// Do not copy opening PHP tag above | |
// Remove comments from specific categories. Change out categories in array as needed. | |
add_action( 'wp_enqueue_scripts', 'wsm_remove_comments_in_category' ); | |
function wsm_remove_comments_in_category() { | |
if ( in_category( array( 'No Comments', 'Uncategorized', ) ) ) { | |
remove_action( 'genesis_after_post', 'genesis_get_comments_template' ); | |
remove_action( 'genesis_after_entry', 'genesis_get_comments_template' ); | |
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' ); | |
remove_action( 'genesis_comments', 'genesis_do_comments' ); | |
remove_action( 'genesis_list_comments', 'genesis_default_list_comments' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment