The code below shows a WordPress loop. How can I modify this loop to show only one post on the page?
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="fullbox" id="post-<?php the_ID(); ?>">
<h3><?php the_category(', ') ?></h3>
<div class="fullbox_content">
<h1><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
So in your case, “n” would be 1.
Found here: http://perishablepress.com/press/2007/08/06/super-loop-exclude-specific-categories-and-display-any-number-of-posts/