last posts in single.php (2 posts)

  1. hamdialkan
    Posted 7 years ago #

    Hi there,

    I want to list last 10 posts from a category in single.php, but I can't. First I tried that one:

    <?php query_posts('cat=3&showposts=10&orderby=title&order=ASC'); ?>

    But it seems that that code doesn't work inside the loop.

    Then I tried that one:

     $posts = get_posts('numberposts=10&category=3');
     foreach($posts as $post) :

    This time it worked, but one little problem: The comments on my blog didn't show up! I mean visitors can add comments to the database, but it doesn't show up in single.php.

    Any help?

  2. hamdialkan
    Posted 7 years ago #

    But really, it shouldn't be that hard.

Topic Closed

This topic has been closed to new replies.

About this Topic