I’m using the following code to show the single most recent post on my landing page:
<?php if (have_posts()) : ?>
<?php if (($wp_query->post_count) > 1) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_excerpt() ?>
<?php endwhile; ?>
<?php else : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_excerpt() ?>
<?php endwhile; ?>
<?php endif; ?>
<?php else : ?>
<p>Nothing to see here.</p>
<?php endif; ?>
My problem is the code doesn’t seem to be producing an excerpt. What could be the problem?
This is the right syntax to show title and the excerpt on home page.