apamphilon

Show latest posts

<?php $the_query = new WP_Query( 'posts_per_page=5' ); ?>
<?php if ($the_query->have_posts()) : ?>
    <ul>
        <?php while ( $the_query->have_posts()) : $the_query->the_post(); ?>
            <li>
                <a href="<?php the_permalink(); ?>">
                    <span class="title"><?php the_title(); ?></span>
                </a>
            </li>
        <?php endwhile; ?>
    </ul>
<?php endif; wp_reset_query(); ?>

Comments: