Last active
October 10, 2016 13:18
-
-
Save richstrauss/9ce1ea1ebe97b09ad63bb6438ecba429 to your computer and use it in GitHub Desktop.
Remove Disqus Comments from Custom Post Types
This file contains 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 | |
// Remove Disqus from Courses custom post type | |
add_filter( 'comments_template' , 'wpe_block_disqus_courses', 1 ); | |
function wpe_block_disqus_courses($file) { | |
if ( 'sfwd-courses' == get_post_type() ) | |
remove_filter('comments_template', 'dsq_comments_template'); | |
return $file; | |
} | |
// Remove Disqus from Lessons custom post type | |
add_filter( 'comments_template' , 'wpe_block_disqus_lessons', 1 ); | |
function wpe_block_disqus_lessons($file) { | |
if ( 'sfwd-lessons' == get_post_type() ) | |
remove_filter('comments_template', 'dsq_comments_template'); | |
return $file; | |
} | |
// Remove Disqus from Topics custom post type | |
add_filter( 'comments_template' , 'wpe_block_disqus_topics', 1 ); | |
function wpe_block_disqus_topics($file) { | |
if ( 'sfwd-topic' == get_post_type() ) | |
remove_filter('comments_template', 'dsq_comments_template'); | |
return $file; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment