• 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: https://athleteswhotweet.com/test/

    I’d really appreciate help with the queries!

    Thanks,

    Jon

Viewing 1 replies (of 1 total)
  • 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.