Pagination with wp_query()
-
Hi,
I am trying to add pagination to my homepage, which collects the last 5 posts from all the categories all over the site. I used a wp_query to show the excerpts:
<?php $altri_post = new WP_Query('showposts=5'); while($altri_post->have_posts()) : $altri_post->the_post();?> <h2><a>"><?php the_title()?></a></h2> <p><?php the_time('d/m/Y'); ?></p> <?php the_excerpt(); ?> <?php endwhile; wp_reset_postdata(); ?>
I would just need 2 links on the bottom with “previous” and “next entries”, but I can’t understand how to do it using wp_query.
- The topic ‘Pagination with wp_query()’ is closed to new replies.