The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › Back End › How do I limit the number of posts displayed on a page?
I am sure this very simple, but I have not found a ready solution on WordPress or StackOverflow. I am hoping someone here can assist.
I have a simple query_posts on a page in WP. I just need to be able to limit the number of posts returned to a specific number. How would I add that code to the following?
<?php query_posts(‘cat=2’); ?>
<?php while (have_posts()) : the_post(); ?>
<h3><?php the_title(); ?></h3>
<?php the_field(‘event_dates’); ?>
<p><?php the_field('event_snippet'); ?></p>
It’s listed in the codex: http://codex.wordpress.org/Template_Tags/query_posts