0

So with all comments disabled on pages/posts theme's still display any existing comments.

Is there a way to programmatically stop this happening without adjust the theme's code?

My plugin uses comments as a journalling type system to log all changes to (custom) posts. On the front end, when my client is logged in there are a number of pages the plugin provides and I do not want the comments to be displayed, but even with comments turned off, existing comments (journal entries) are shown at the foot of the page, which I do not want

0

OK I think I figured this out...

    add_action( 'init', array( &$this, 'no_comments' ) );

    function no_comments()  {
        add_filter( 'get_comments_number', '__return_false' );  
    }

Removes the comment count and the comments themselves

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.