• Learn how to Run Mac Snow-Leopard on Ubuntu using Oracle Sun Virtual-box
  • Are you a Turbo C++ addict/? Learn how to emulate Turbo c++ with Dos-box in a few steps.
  • Ubuntu's purple love-- A Clean and minimalistic wallpaper for your Desktop.

Hide Disqus form on static pages



Disqus comment system is a great plugin  for displaying comments on your blog,   Sometimes its not really needed on certain pages like your 'contact us' page or 'about us' and it is a common practice of disabling comments on static pages. Heres how you could hide disqus on your wordpress static pages.


In the Disqus plugin, open up the file "disqus-comment-system/disqus.php"
Scroll down to the "Filters/Actions" section.
You should see code that looks like this:
if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) {
        return;
    }

    if ( !dsq_is_installed() || !dsq_can_replace() ) {
        return $value;
    }
Above, below or in between these lines, insert this line of code:
if ( ('closed' == $post->comment_status) || ('page' == $post->post_type)){
return;
}
 and that should do it.


5 comments:

Anonymous said...

It works alltogether with Disable Comments plugin for wordpress

Letaulier said...

Cela marche enfin! Après avoir essayé 3/4 méthode trouvées sur le net sans succès.

Srinivas Gowda said...

@Letaulier: je vous en prie

Antanas Goriunovas said...

I did it, it works, but now on my page (leave your feedback) where comments are enable, appears Wordpress comments form, but not Disqus. Can You help me to solve this problem? Thanks.

jack wilson said...

Your posts is really helpful for me.Thanks for your wonderful post. I am very happy to read your post. It is really very helpful for us and I have gathered some important information from this blog.

Web Design Company in Chennai

Post a Comment