'best-news-popular-news-comment-widget', 'description' => __('Tab Popular news & Comments Widget','best-news'), ); parent::__construct( 'best_news_popular_news_comment','Bnews:Popular news & Comments Widget Place it within "Sidebar"', $widget_ops ); } function form( $instance ) { $post_no = ! empty( $instance[ 'post_no' ] ) ? $instance[ 'post_no' ] : 4; $comment_no = ! empty( $instance[ 'comment_no' ] ) ? $instance[ 'comment_no' ] : 4; ?>

'post', 'number' => $comment_no ); // The comment query $comments_query = new WP_Comment_Query; $comments = $comments_query->query( $args ); // The comment loop if ( !empty( $comments ) ) { foreach ( $comments as $comment ) {?>