'widget-beginner-tabs widget_tabs posts-thumbnail-widget', 'description' => __( 'Display popular posts, recent posts, recent comments and tags in tabs.', 'beginner' ) ); // Create the widget. parent::__construct( 'beginner-tabs', // $this->id_base __( '» Tabs', 'beginner' ), // $this->name $widget_options // $this->widget_options ); } /** * Outputs the widget based on the arguments input through the widget controls. * * @since 1.0.0 */ function widget( $args, $instance ) { extract( $args ); // Output the theme's $before_widget wrapper. echo $before_widget; ?>
$number, 'orderby' => 'comment_count', 'post_type' => 'post' ); // The post query $popular = new WP_Query( $args ); global $post; if ( $popular->have_posts() ) { $html = '