I am using this code to show 3 most popular posts based on number of comments :
<?php
$pop_posts = 3;
$popularposts = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title, COUNT($wpdb->comments.comment_post_ID) AS 'stammy' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND comment_status = 'open' GROUP BY $wpdb->comments.comment_post_ID ORDER BY stammy DESC LIMIT ".$pop_posts;
$posts = $wpdb->get_results($popularposts);
if($posts){
foreach($posts as $post){
$post_title = stripslashes($post->post_title);
$guid = get_permalink($post->ID);
$thumb = get_post_meta($post->ID,'_thumbnail_id',false);
$thumb = wp_get_attachment_image_src($thumb[0], 'popular-posts-image', false);
$thumb = $thumb[0];
?>
<?php if ($thumb) { ?>
<img src="<?php echo $thumb; ?>" width=80 height=80 />
<?php } ?>
<h4><a href="<?php echo $guid; ?>" title="<?php echo $post_title; ?>"><?php echo $post_title; ?></a></h4>
<div class="clear"></div>
<?php
}
}
?>
but I want to use this code in two different places, so I want to offset the first 3 posts. Is there any way I can offset the three posts? thanks