• Hi there. I’m currently running multiple loops to get a category listing to display in two columns, but now I need to separate out the first two posts to display them differently (like featured posts) but I can’t seem to figure out how to do so without them being repeated again in the two column loops. Any help is appreciated.

    The two column loop code is like this so far:

    <div id="left-column">
    <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) == 0) : $wp_query->next_post(); else : the_post(); ?>
    <?php woo_image('key=image&width=280&height=125&class=img'); ?>
    <h3 class="cat-title"><?php the_category(', ') ?></h3>
    <h1 class="title"><?php the_title(); ?></h1>
    <div class="entry">
    <?php echo woo_excerpt( get_the_excerpt(), '300'); ?><br />
    <span class="more"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> &raquo; <?php _e('read more','woothemes'); ?></a></span>
    </div>
    
    <?php endif; endwhile; else: ?>
    <div>Alternate content</div>
    <?php endif; ?>
    </div>
    
    <?php $i = 0; rewind_posts(); ?>
    
    <div id="right-column">
    <?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) !== 0) : $wp_query->next_post(); else : the_post(); ?>
    
    <?php woo_image('key=image&width=280&height=125&class=img'); ?>
    <h3 class="cat-title"><?php the_category(', ') ?></h3>
    <h1 class="title"><?php the_title(); ?></h1>
    <div class="entry">
    <?php echo woo_excerpt( get_the_excerpt(), '300'); ?><br />
    <span class="more"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> &raquo; <?php _e('read more','woothemes'); ?></a></span>
    </div>
    
    <?php endif; endwhile; else: ?>
    <div>Alternate content</div>
    <?php endif; ?>
    
    </div>

    If there’s anyone that might be able to help me with what to add to that to style posts 1 and 2, I would be forever in your debt. Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Featured Post and Multiple Loops’ is closed to new replies.