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
590
Replies
2
Views
789
Recommended threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top