Results 1 to 2 of 2

Thread: Multiple Loops w/ Pagination

  1. #1
    hoss9009 is offline Hello World
    Join Date
    Jun 2010
    Posts
    20

    Icon9 Multiple Loops w/ Pagination

    So I'm trying to get this page going with TWO query loops and I'm trying to get pagination going on it, too.
    I found this plugin and it's not working for me. It says I can put it "anywhere".
    Here's my code:

    Code:
    <?php
    $latestPost = new WP_Query();
    $latestPost->query('posts_per_page=1');
    while ($latestPost->have_posts()) : $latestPost->the_post(); ?>
    <div id="red-news"></div>
    <div id="left">
    <div class="latest-post"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <div class="date"><span class="month"><?php the_time('M') ?></span><span class="day"><?php the_time('j') ?></span><span class="year"><?php the_time('Y') ?></span></div>
    <div class="thumbnail"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail( 'latest-post-thumbnail' ); ?></a></div>
    <div class="entry"><?php the_excerpt(); ?><div class="read-more"><a href="#">read more ></a></div>
    </div><div class="clear"></div></div><!-- end LATEST POST --><?php endwhile; ?>
    <?php
    $latestPost = new WP_Query();
    $latestPost->query('posts_per_page=2&offset=1');
    while ($latestPost->have_posts()) : $latestPost->the_post(); ?>
    <div class="post">
    <div class="date"><span class="month"><?php the_time('M') ?></span><span class="day"><?php the_time('j') ?></span><span class="year"><?php the_time('Y') ?></span></div>
    <div class="thumbnail"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a></div>
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <div class="entry"><?php the_excerpt(); ?>
    <div class="read-more"><a href="#">(...)</a></div>
    </div>
    <div class="clear"></div>
    </div><!-- end POST -->
    <?php endwhile; ?>
    I'm not sure where to implement the php string, specifically if it needs to be in the loop and which one it is.

  2. #2
    Jarret's Avatar
    Jarret is offline Hello World
    Join Date
    Feb 2009
    Location
    California
    Posts
    21

    Default

    I ran into this same problem just the other night when a client requested something. She wanted to have a "featured post" showing the full post and then a list of posts below that showing just the post excerpts.

    http://weblogtoolscollection.com/arc...ts-and-paging/

    That is the fixed that I used and it works for me. Let me know if that works for you :)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •