Comments are not visible
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.
xBloodshed Selected answer as best
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 );
xBloodshed Selected answer as best
Rahul Aryan commented
Are you using DIVI?
xBloodshed commented
Yes. Using Divi theme.
Thanks a lot. This worked.