I am using two custom loops to display items from different tags in different areas of a “static” main page. I would like the content to be displayed randomly, something like a random blurb on the main page each time it is reloaded.
<div id="loop1"> <?php query_posts('cat=6&showposts=1&orderby=rand'); ?> <?php $posts = get_posts('category=6&numberposts=1&offset=0'); foreach ($posts as $post) : start_wp(); ?> <?php the_content(); ?> <?php endforeach; ?> </div>
Both loops are exactly the same but use a different category. I know the loops work because the last post of each is displayed, the only problem is orderby=rand is not loading anything different on a reload.
Any help with the issue would be appreciated. If you have questions please ask.
- The topic ‘orderby=rand Not working on custom loops’ is closed to new replies.