Comments are not visible

Solved5.03K viewsIssues
0

Comments on any questions or answers are not visible. I have checked on the admin page and all comments are approved. Yet they don’t show in anspress.

Question is closed for new answers.
Selected answer as best
1

Please add this filter to your theme:

add_filter( 'get_comments_number', function( $count, $post_id ) {
    global $post_type;
     $ajax_func = defined( 'DOING_AJAX' )
                    && DOING_AJAX == true
                    && isset( $_REQUEST['action'] )
                    && ( $_REQUEST['action'] == 'ap_form_comment' );
     if ( $post_type == 'question' || $ajax_func ) {
        $get_comments     = get_comments( array(
            'post_id' => $post_id,
            'status'  => 'approve'
        ) );
        $comments_by_type = separate_comments( $get_comments );
         $count = count( $comments_by_type['anspress'] );
    }
     return $count;
     }, 11, 2 );

Selected answer as best

Thanks a lot. This worked.

You are viewing 1 out of 2 answers, click here to view all answers.