Remove Comments for Specific Post Categories
-
There are some outdated plugins but looking for a current function.php entry to remove comment functionality except for a specific post category.
Found some old code which does not work but in the neighborhood.
add_action( 'wp_enqueue_scripts', 'remove_comments_specific_categories' ); function remove_comments_specific_categories() { if ( !in_category( '17' ) ) { remove_post_type_support($post_type, 'comments'); } }
Any suggestions would be helpful.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove Comments for Specific Post Categories’ is closed to new replies.