Help with Random Posts via Category Not quite working!
-
Hi,
I’ll I’m trying to do is to get 6 random posts pulled out of the “feature” category at random and display their featured picture (little 100x100px) image in a box on the right side of my site.
I have it mostly working if I remove “orderby=rand” it shows all 6 images in the right hand box of the latest 6 featured posts but I also want it to display older posts from the category hence trying to get it to randomise it.
When I add the orderby=rand I get it randomly picking out older posts which is good but it also randomly displays between 1 and 6 posts instead of 6 random ones and I have no idea why.
<?php query_posts('category_name=feature&showposts=6&orderby=rand'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
Any ideas/help would be grateful.
Thanks
MouseUK
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Help with Random Posts via Category Not quite working!’ is closed to new replies.