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:
It works alltogether with Disable Comments plugin for wordpress
Cela marche enfin! Après avoir essayé 3/4 méthode trouvées sur le net sans succès.
@Letaulier: je vous en prie
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.
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/
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