WordPress.org

Support

Support » How-To and Troubleshooting » Post pagination

Post pagination

  • Hey guys I have this code that shows recent posts

    <ul>
        <?php $the_query = new WP_Query( 'showposts=10' ); ?>
    
        <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
        <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    
        <li><?php the_content(__('(moreā€¦)')); ?></li>
        <?php endwhile;?>
        </ul>

    I want to paginate this with this code

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    query_posts('posts_per_page=3&paged=' . $paged);
    ?>

    How can I combine it

    Please.

Viewing 1 replies (of 1 total)
  • sorry

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    query_posts('posts_per_page=10&paged=' . $paged);
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Post pagination’ is closed to new replies.