Title: Using Showposts offset with Specific Post Format
Last modified: August 20, 2016

---

# Using Showposts offset with Specific Post Format

 *  [Lonnie](https://wordpress.org/support/users/lonniehb/)
 * (@lonniehb)
 * [14 years ago](https://wordpress.org/support/topic/using-showposts-offset-with-specific-post-format/)
 * I’m building a site that shows featured images from the blog in different sizes
   on the home page. I have that working fine using the code below. What I now want
   to do is limit the posts on the home page to one specific category.
 * I’ve found some examples, but none are working for me. Any help is appreciated.
   Thanks.
 *     ```
       <!-- FIRST LOOP: display posts 1 thru 2 -->
       <?php query_posts('showposts=2'); ?>
       <?php $posts = get_posts('numberposts=2&offset=0'); foreach ($posts as $post) : start_wp(); ?>
       <?php static $count1 = 0; if ($count1 == "2") { break; } else { ?>
   
       <a href="<?php the_permalink() ?>">
       <div class="smallbox">
       <?php the_post_thumbnail( 'newwork-small' ); ?>
       </div></a>
   
       <?php $count1++; } ?>
       <?php endforeach; ?>
   
       <!-- SECOND LOOP: display post 3 -->
       <?php query_posts('showposts=1'); ?>
       <?php $posts = get_posts('numberposts=1&offset=2'); foreach ($posts as $post) : start_wp(); ?>
       <?php static $count2 = 0; if ($count2 == "1") { break; } else { ?>
   
       <a href="<?php the_permalink() ?>">
       <div class="medbox">
       <?php the_post_thumbnail( 'newwork-med' ); ?>
       </div></a>
   
       <?php $count2++; } ?>
       <?php endforeach; ?>
       ```
   

The topic ‘Using Showposts offset with Specific Post Format’ is closed to new replies.

## Tags

 * [specific category](https://wordpress.org/support/topic-tag/specific-category/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Lonnie](https://wordpress.org/support/users/lonniehb/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/using-showposts-offset-with-specific-post-format/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
