• Hi.
    I’m trying to build a portfolio page. I have content (one post) in the single.php, and I have a query_posts() loop under wich shows thumbnails to the other posts. The ting is that i want a “more button”, so that i can show tree and tree thumbs.

    This is the code i have, but the “more button” does not work.

    <?php query_posts('showposts=3'.'paged=' . get_query_var('paged')); while ( have_posts() ) : the_post() ?>
    
    <div class="post_excerpt" id="post-<?php the_ID(); ?>">
    <a href="<?php the_permalink() ?>"><?php the_post_thumbnail(array(200,200)); ?> </a>
    </div>
    
    <?php endwhile; ?>
    <p><?php posts_nav_link(); ?></p>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The ‘more’ button only works for the_content().

    Thread Starter patriktg

    (@patriktg)

    Yes, I get that, but surely there has to be a way around that?
    Some way to show three posts and then the next three posts and so on.

    OK – I misunderstood what you wanted. I thought you wanted 3 more images from the same page.

    I think your query string is missing an ampersand just ahead of paged=:

    <?php query_posts('showposts=3'.'&paged=' . get_query_var('paged'));

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘query_posts() in single.php with next button’ is closed to new replies.