last posts in single.php
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:
<?php $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.
- The topic ‘last posts in single.php’ is closed to new replies.