'widget-posts', 'description' => __('A widget that display popular posts, recent posts, recent comments and tags.', 'huddle') ); $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'widget-posts' ); $this->WP_Widget( 'widget-posts', __('Huddle: Tabbed Posts', 'huddle'), $widget_ops, $control_ops ); } function widget( $args, $instance ) { global $wpdb; extract( $args ); $title = apply_filters('widget_title', $instance['title'] ); $title_popular = $instance['title_popular']; $title_recent = $instance['title_recent']; $title_comments = $instance['title_comments']; $display_count = $instance['display_count']; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; ?>
query( 'showposts=' . $display_count . '&orderby=comment_count' ); ?>
have_posts()) : $huddle_popular_posts->the_post(); ?>

,
query('showposts='.$display_count.''); ?>
have_posts()) : $huddle_recent_posts->the_post(); ?>

,
comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT ".$display_count; $huddle_recent_comments = $wpdb->get_results($huddle_recent_comments_query); foreach ($huddle_recent_comments as $huddle_recent_comment) { ?>

comment_author); ?>

comment_excerpt); ?>...
'', 'title_popular' => 'Popular', 'title_recent' => 'Recent', 'title_comments' => 'Comments', 'display_count' => 5, ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>