WP_Query
-
EDIT: realised I’ve posted this in the wrong area. Can someone move it to hacks?
I’ve got this code in my theme to pull the featured images of the 5 most recent posts of a custom post type (‘reviews).
<?php $the_query = new WP_Query('post_type=reviews&showposts=5&orderby=date&order=desc'); while ($the_query->have_posts()) : $the_query->the_post(); ?> <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail('index-book', array ('class' => 'alignleft')); ?></a> <?php endwhile; ?> <?php wp_reset_query(); ?>
But what I really want to do is show just 5 to start with and then enable an expanding “load more” which will then load 5 more underneath. How would I go about doing this?
- The topic ‘WP_Query’ is closed to new replies.