how to disable disqus for custom post types in wordpress

Earlier we also used disqus comment system. But now we stopped using disqus. Disqus comment system is most powerful and popular third-party comments tool. this tool is really great. With disqus you don’t need to worry about spam comments. Some times we faced slowness with disqus comments system so we stopped using disqus comments system.

If you want to use disqus comment system then go to following URL and download from here

Disqus Comment System

Disqus, pronounced “discuss”, is a service and tool for web comments and discussions. Disqus makes commenting easier and more interactive, while connecting websites and commenters across a thriving discussion community. The Disqus for WordPress plugin seamlessly integrates using the Disqus API and by syncing with WordPress comments.

how to disable disqus for custom post types in wordpress

If you are creating premium theme. Or you are trying to create the wordpress theme for your client than you need to control everything through your theme control panel. Using following code you can easily control disqus comment system through your wordpress theme code.

how to disable disqus for custom post types in wordpress
how to disable disqus for custom post types in wordpress

We given step for disable disqus for custom post types in wordPress with code.

What you need is, just copy and paste following code in functions.php file (wordpress theme).  Use following 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;
}

Note: do not forget to change the “custom_post_type_name” name as per your custom post name.
Above code will check for custom post type and if current post with given custom post name than disqus comments will be disabled. This is safe way to disable disqus comments for custom posts.

You can use the Appearance ->Editor option also. Open functions.php file in Editor and at end of file Just put above code.

Following are some Useful article related to wordpress comments:

how to add adsense to wordpress blog

Many people wants to put ads on their wordpress blog because you can earn money from it. In this post we are going to show you step by step that how to add adsense in your wordpress site which is very simple. In article we shown steps for, how to add adsense to wordpress blog which is simple. Without code change you add google adsense in wordpress blog or website.

You might useful our another article of how many google ads you can show on single webpage. Hope you’ll find useful.

how to add adsense to wordpress blog

Lets get started.

  • Step 1: Login to your administrative and click on the Appearance menu which is on left side. When you will click on Appearance it will show you dropdown list, in that list you have to click on Widgets menu.

: Appearance >> Widgets

how to add adsense to wordpress blog
how to add adsense to wordpress blog

 

  • Step 2: Now choose a ” Text ” Widget and simply drag it in your Sidebar.
how to add adsense to wordpress blog
how to add adsense to wordpress blog
  • Step 3: Now a new window of your Text Widget will open. According to us you should add Advertisement for title and put the actual code that you have obtained from google under the title. Finally click on Save button which is on bottom right of window.

 

how to add adsense to wordpress blog
how to add adsense to wordpress blog

 

Well done! You have added adsense code in your wordpress blog.