WordPress.org

Ready to get started?Download WordPress

Forums

Disqus Comment System
Disable on certain posts/post types? (5 posts)

  1. greencode
    Member
    Posted 2 years ago #

    I'm using Disqus along with either Jigoshop or WooCommerce shop solutions but the problem is that when I use Disqus the reviews function of those plugins does not show up as Disqus tries to take over the review commenting.

    I just need to be able to disable Disqus on certain posts/categories or post types.

    Any ideas?

    http://wordpress.org/extend/plugins/disqus-comment-system/

  2. Daniel J. Lewis
    Member
    Posted 1 year ago #

    Did you ever figure this out? I need to do the same thing.

  3. Daniel J. Lewis
    Member
    Posted 1 year ago #

    GOT IT!

    In Disqus version 2.74, open disqus.php and go to line 149. It currently has:

    $replace = get_option('disqus_replace');
    
        if ( is_feed() )                       { return false; }
        if ( 'draft' == $post->post_status )   { return false; }
        if ( !get_option('disqus_forum_url') ) { return false; }
        else if ( 'all' == $replace )          { return true; }

    Add the following new line before all of those "if" statements:

    if ( is_singular('product') ) { return false; }

    Save and re-upload the file and you can now leave reviews on products without disabling Disqus!

  4. Daniel J. Lewis
    Member
    Posted 1 year ago #

    Oops. My bad. That wasn't the right code. That will show the reviews area, but will still prevent reviews from posting.

    So add the following line instead of what I previously said to add:
    if ( 'product' == get_post_type() ) { return false; }

  5. Daniel J. Lewis
    Member
    Posted 1 year ago #

    (Last post from me.)

    I documented this process more thoroughly: How to disable Disqus on WordPress custom post types

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.