I’m trying to stop the pagenumbers from showing when using WP_Query to show posts from a category. I only want to show the 3 most recent posts and don’t want the option to go to any other page.
I’m using the following code:
<?php $wp_query = new WP_Query(); $wp_query->query('category_name=NEWSITEMS&showposts=3'); ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <li><a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a> </li> <?php endwhile; ?>
I’ve tried different parameters like is_paged and paged, but that doesn’t seem to do what I’m trying to achieve.
Any help would be greatly appreciated!
- The topic ‘Disabling pagenumbers/pagination with WP_Query’ is closed to new replies.