Hello, i want to paginate my wordpress query. the code is
WP experts, help me
This query returns 20 results, but i want to paginate it and show 5 results in each page.<?php $recent = new WP_Query("cat=1&showposts=20"); while($recent->have_posts()) : $recent->the_post();?>
<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" width="90" height="90" alt="<?php the_title(); ?>" /></a>
<?php else: ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" width="90" height="90" alt="<?php the_title(); ?>" /></a>
<?php endif; ?>
<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php endwhile; ?>
WP experts, help me
Last edited: