>

>

5, 'author' => get_the_author_meta( 'ID' ), 'orderby' => 'comment_count', 'suppress_filters' => 0, ); $postsQuery = new WP_Query( apply_filters( 'graphene_author_popular_posts_args', $args ) ); // Check if at least one of the author's post has comments $have_comments = NULL; $comments_ol_html = ''; while ( $postsQuery->have_posts() ){ $postsQuery->the_post(); setup_postdata( $post); $nr_comments = get_comments_number(); /* List the post only if comment is open * and there's comment(s) * and the post is not password-protected */ if (comments_open() && empty( $post->post_password) && $nr_comments != 0){ $have_comments = TRUE; $comments_ol_html .= '
  • '. ( get_the_title() == '' ? __( '(No title)','graphene' ) : get_the_title() ) . ' — '. ( sprintf( _n( '%s comment', '%s comments', $nr_comments, 'graphene' ), number_format_i18n( $nr_comments ) ) ). '
  • '; } } if ( $have_comments) : ?>