WordPress.org

Support

Support » Plugins and Hacks » Hide Disqus form on static pages

Hide Disqus form on static pages

  • I need a way to hide the Disqus comment form on Static Pages. Closing comments only keeps the form visible and displays “Comments are closed”. I need the entire form to be hidden. I found some code that I added to the Disqus plugin that worked, but when I upgraded the plugin it erased the added code. Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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_single() || is_page() || $withcomments) ) {
    		return;
    	}
    if ( !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;
    }

    That should do it.

    Cheers

    Tina — thank you! Had the problem, searched the forum, found your solution, tried it out, works perfectly. Thanks!

    Thankyou very much.. i had the same problem.. your solution fixed it perfectly.. A+

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide Disqus form on static pages’ is closed to new replies.
Skip to toolbar