Here's the link to code for the Recent/Popular posts widget
<?php
/**
- MyThemeShop Tabs Widget */ function mts_popular_tabs( $posts = 3 ) { $popular = new WP_Query('showposts='. $posts .'&orderby=comment_count&order=desc'); $popular_post_num = 1; while ($popular->have_posts()) : $popular->the_post(); ?>
<div id="tabber">
<ul class="tabs">
<li><a href="#popular-posts"><?php _e('Popular Posts', 'mythemeshop'); ?></a></li>
<li class="tab-recent-posts"><a href="#recent-posts"><?php _e('Recent Posts', 'mythemeshop'); ?></a></li>
</ul> <!--end .tabs-->
<div class="clear"></div>
<div class="inside">
<div id="popular-posts">
<ul>
<?php rewind_posts(); ?>
<?php mts_popular_tabs($popular_post_num); ?>
</ul>
</div> <!--end #popular-posts-->
<div id="recent-posts">
<ul>
<?php mts_latest_tabs($recent_post_num); ?>
</ul>
</div> <!--end #recent-posts-->
<div class="clear"></div>
</div> <!--end .inside -->
<div class="clear"></div>
</div><!--end #tabber -->
<?php
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['popular_post_num'] = $new_instance['popular_post_num'];
$instance['recent_post_num'] = $new_instance['recent_post_num'];
return $instance;
}
function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array( 'popular_post_num' => '5', 'recent_post_num' => '5') );
$popular_post_num = $instance['popular_post_num'];
$recent_post_num = format_to_edit($instance['recent_post_num']);
?>
<p><label for="<?php echo $this->get_field_id('popular_post_num'); ?>"><?php _e('Number of popular posts to show::'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('popular_post_num'); ?>" name="<?php echo $this->get_field_name('popular_post_num'); ?>" type="text" value="<?php echo $popular_post_num; ?>" /></p>
<p><label for="<?php echo $this->get_field_id('recent_post_num'); ?>"><?php _e('Number of latest posts to show:'); ?></label>
<input class="widefat" type="text" id="<?php echo $this->get_field_id('recent_post_num'); ?>" name="<?php echo $this->get_field_name('recent_post_num'); ?>" value="<?php echo $recent_post_num; ?>" /></p>
<?php }
}
register_widget('mts_Widget_Tabs');
? http://pastebin.com/YbMhKAMV
Blockquote