• 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.


7 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.

Unknown said...

@Letaulier: je vous en prie

Unknown 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.

TA said...

How much information is too much information? Get all your HR report crafting questions answered right here, right now. https://www.peoplehum.com/blog/hr-reports-all-you-need-to-know/ 

Rishi said...
This comment has been removed by the author.
Rishi said...

Our freshest blogs, a collection of great reads, podcasts, videos and more, freshly picked and curated for you. Catch up with what’s been happening in the world of HR and work, with peopleHum’s monthly Roundup newsletter https://peoplehum.com/blog/peoplehums-roundup-newsletter-july-2021

Post a Comment