Quote:
Originally Posted by nexcom28
I have several categories, one of them being for example 'news'. I am wanting to random the posts within this category only.
Currently all posts in all categories are random.
Thanks
|
I think the best way for that then would be to copy category.php to category-news.php (make sure the "news" portion matches the category slug), or to category-ID.php (where ID = the news category ID). You can find the info you need in wp-admin -> Posts -> Categories.
Then, just remove the "query_posts($query_string."&orderby=rand");" from the base category.php file, and you should be good to go.
And then, for any other categories you may want to display random posts for in the future, simply copy category-news.php (or category-ID.php) to category-slug.php (or category-ID.php, again specifying the numeric ID of said category).
More info here:
http://codex.wordpress.org/Category_Templates