'ac_popular_posts_widget', 'description' => 'Displays your most popular articles.' ); // Create the widget $this->WP_Widget( 'ac_popular_posts_widget', __('ACOSMIN: Popular Posts', 'acosmin'), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); // Widget Settings $title = apply_filters('widget_title', $instance['title'] ); $popular_posts_number = $instance['popular_posts_number']; echo $before_widget; // Widget Front End Output if ( $title ) { echo $before_title . $title . $after_title; } $args = array( 'orderby' => 'comment_count', 'posts_per_page' => $popular_posts_number, 'ignore_sticky_posts' => 1 ); $wp_query = new WP_Query(); $wp_query->query($args); $count = 0; ?>
¬