[resolved] Show X numbers of posts in a X category (2 posts)

  1. ddcassy
    Posted 8 years ago #

    Hi, I've found this code:

            <?php $ultimos_post = get_posts('numberposts=5&category=1'); foreach($ultimos_post as $post) :?>
    <li><a>"><?php the_title(); ?></a></li>
            <?php endforeach; ?>

    This code shows the 5 last posts in the category 1.
    I've expend many hours trying to found this code, and finaly I Found it, I couldn't found it in this forum or in the wordpress codex, so I publish the solution for this problem.

  2. sp360
    Posted 8 years ago #

    what file is it in?

Topic Closed

This topic has been closed to new replies.

About this Topic