Randomize posts in a category?
-
I’m building an e-commerce shop and I’m using posts to feature products. Each post is listed in multiple categories and also tagged. What I’d like to do is display the categories in the sidebar and when the user clicks, it loads the category page (customized to only display the thumbnail image for each post in a grid format). I’d like for this grid to display the products randomly each time so older products aren’t lost in the sea of new items. The user can then page through to see the rest as some categories will contain hundreds of product designs. Is that possible with a category page?
I know how to do this with query_posts by specifying a category and random post, but I don’t want to create a separate category template page for each category because the categories get added on the fly as new products are added. I also want the same thing for tag pages and for the search results.
Can this be done? If so, can someone point me in the right direction for coding it. Thanks.
- The topic ‘Randomize posts in a category?’ is closed to new replies.