I currently have this query_posts that i have done, (I am new to PHP!) And would like to know how I would go about limiting it to latest 4 posts and 4 posts only..
<?php query_posts('post_type=page&post_parent=2&posts_per_page=-1&orderby=title&order=ASC'); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<!-- Calender Items -->
<?php $key = 'next_open_day'; $themeta = get_post_meta($post->ID, $key, TRUE); if($themeta != '') {
echo '<div class="mopenday">';
echo '<img src="';
the_field('university_main_image');
echo '" width="160" height="40" />';
echo '<br />';
echo '<h2 class="od">';
echo '<a href="';
the_permalink();
echo '">';
the_title();
echo '</a>';
echo '</h2>';
echo '<p class="mdate">';
the_field('next_open_day');
echo '</p>';
echo '<p>';
the_field('open_day_description');
echo '</p>';
echo '<a class="visitweb" target="_blank" href="http://';
the_field('university_web_address');
echo '">';
echo 'Visit Website';
echo '</a>';
echo '</div>';
} ?>
<!-- END OF CALENDER ITEM -->
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<!-- END OF PHP OPEN DAYS -->