WordPress.org

Ready to get started?Download WordPress

Forums

Hide Disqus form on static pages (4 posts)

  1. ecoaction
    Member
    Posted 4 years ago #

    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?

  2. TinaHunter
    Member
    Posted 4 years ago #

    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

  3. pmkelly
    Member
    Posted 4 years ago #

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

  4. dubjohnston
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic