Add random sort option to query_posts
-
There are a bunch of plugins offering random this or that with respect to posts, but the most versatile solution is to have random posts going into The Loop. I used the solution given by Kafkaesqui here to get a set of random posts. Works great, but it would be nice to add an option to the query_posts function to minimize the effort.
Already you can write:
<?php query_posts('showposts=5&order=ASC'); ?>
How about adding:
<?php query_posts('showposts=5&order=RAND'); ?>
I am still learning the setup of the WP files. Once I get things down I might try to submit the change myself, but I thought I’d submit it here as a suggestion. Anyone else think this addition would be useful or worthwhile? For those looking for a solution now, do check out the link above.
- The topic ‘Add random sort option to query_posts’ is closed to new replies.