Loop in sidebar show all post instead of the last 10 when viewing singel post
-
Ok, so, I’m running this loop to get the latest posts in my sidebar…
<?php $archive_query = new WP_Query('showposts=10'); while ($archive_query->have_posts()) : $archive_query->the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br /><span>Postat <?php the_time('l j F, Y'); ?></span></li> <?php endwhile; ?>
…and it works fine when I’am on index but as soon as I go to a singel post view it doesn’t work, it print’s out ALL the post, not just the last 10!
Anyone know what the problem might be?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Loop in sidebar show all post instead of the last 10 when viewing singel post’ is closed to new replies.