Title: Query Custom Posts
Last modified: August 20, 2016

---

# Query Custom Posts

 *  [JSauce16](https://wordpress.org/support/users/jsauce16/)
 * (@jsauce16)
 * [15 years ago](https://wordpress.org/support/topic/query-custom-posts/)
 * Hello,
 * I am looking to do a fairly simple thing, but am bad with queries, I was hoping
   someone could help me out.
 * I want to show the most recent post from a custom post type, call it “stories”.
   Then, I want to show the next three from the same type in a different HTML format.
 * I also have a content slider that pulls from another type, call it “quotes.” 
   This should pull the 30 most recent quotes.
 * You can get an idea of what I’m trying to do here: [http://athleteswhotweet.com/test/](http://athleteswhotweet.com/test/)
 * I’d really appreciate help with the queries!
 * Thanks,
 * Jon

Viewing 1 replies (of 1 total)

 *  [silafu](https://wordpress.org/support/users/silafu/)
 * (@silafu)
 * [15 years ago](https://wordpress.org/support/topic/query-custom-posts/#post-2091480)
 * Try this
 *     ```
       <?php query_posts('post_type=stories&showposts=6');?>
   
       <?php $my_query = new WP_Query('post_type=stories&showposts=6'); $count = 1;
         while ($my_query->have_posts()) : $my_query->the_post();
         global $more; $more = 0; //keep read more functionality
         ?>
   
       <?php if ($count++ < 4) { ?>
        ----stuff for first 3---
   
        <?php } else { ?>
         ----stuff for last 3---
   
       <?php } endwhile; ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Query Custom Posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [silafu](https://wordpress.org/support/users/silafu/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/query-custom-posts/#post-2091480)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
