Two wordpress loops with a different number of posts in each? Anyone know how?

Discussion in 'HTML & Website Design' started by Exnie, Mar 29, 2009.

  1. #1
    Hello,

    I am in the process of coding my new portfolio in wordpress. On the front page I have two loops. One displays two featured designs and the other displays one testimonial.

    The code goes something like this:
    
    <?php query_posts('showposts=2&cat=23'); ?>
    
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <?php $values = get_post_custom_values("Thumbnail"); echo $values[0]; ?>
    
    <?php endwhile; ?>
    <?php endif; ?>
    
    
    ?php rewind_posts(); ?>
    
    <?php query_posts('showposts=1&cat=23'); ?>
    
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <?php the_content(); ?>
    
    <?php endwhile; ?>
    <?php endif; ?>
    
    Code (markup):

    This doesn't seem to be working though. Does anyone know a way to modify two loops differently? I think the problem might be happening because the top "query_posts" is modifying both the loops.

    Thanks for you help.

    Ben
     
    Exnie, Mar 29, 2009 IP