Disable Disqus for Custom Post Types on WordPress?

hoangvu

New member
Joined
Jun 6, 2012
Messages
1,835
Points
0
Hello

I want to disable Disqus for Custom Post Types on WordPress?
Is it possible? and how to do that?

Please suggest me
 

Alex Thompson

Moderator
Joined
Jun 6, 2013
Messages
651
Points
43
If you are using the Disqus comment system for displaying comments on your website or blog, it surely must be familiar with the functionality it provides. If you want to disable it on the custom post types on your website or blog, then this tip will help you do that.

You just insert the following code into your functions.php file (located in the theme folder you are using).

Code:
add_filter( 'comments_template' , 'wpb_block_disqus', 1 );
function wpb_block_disqus($file) {
if ( 'custom_post_type_name' == get_post_type() )
remove_filter('comments_template', 'dsq_comments_template');
return $file; 
}
In the code above, you remember to change the name of the custom post type custom_post_type_name that you want to disable the display on it flashed Disqus.

With simple tips, you can better manage your website or blog running on their WordPress platform.:)
 
Latest threads
Replies
0
Views
28
Replies
0
Views
31
Replies
1
Views
39
Replies
3
Views
94
Recommended threads
Replies
3
Views
2,749
Replies
6
Views
4,550
Replies
5
Views
2,913
Top