Disable Disqus for Custom Post Types on WordPress?

Marc0

Well-known member
Registered
Joined
Jun 6, 2012
Messages
890
Points
28
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

Well-known member
Moderator
Joined
Jun 6, 2013
Messages
297
Points
28
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.:)
 
Newer Threads
Replies
26
Views
9,373
Replies
6
Views
4,508
Replies
6
Views
4,572
Latest Threads
Replies
0
Views
123
Replies
1
Views
79
Recommended Threads
Replies
7
Views
4,811
Replies
9
Views
10,153

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

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