query_posts()
allows for an argument called orderby
, there you can provide how you want your posts sorted. So a solution could look like this
$args['orderby'] = 'rand';
query_posts($args);
For a full list and explanation of the query arguments, check WordPress Developer Resources on WP_Query
Related Posts:
- How to display related posts from same category?
- How to show related posts by category
- Use category base slug in posts’ permalink
- Display all posts from specific categories on a page
- Display the latest post from a category in a page
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How to disable Uncategorized category URL?
- Add role that restricts user to post in specific category
- Count posts in category including child categories
- How to control which category will be picked for the slug of a post?
- Add default content to post (for specific category)
- Query only Posts from Both of Two Category?
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- Display most recent post in category instead of archive?
- Archived Posts in Wrong Category
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- Display all posts under child sub category in sidebar on post page?
- How do I get the slug of a custom taxonomy category of a post?
- Featured Posts for Category Pages
- Authors in menu, template list post by author
- How to set post expiration date and time and move the page to archive after expiration [closed]
- Count to how many categories a post belongs to
- Exclude posts from featuring
- How can I remove posts of a certain category from homepage after a specified time period?
- Add icon/badge next to posttitle of specific category
- Edit custom post type admin menu link
- How to display WordPress archive into three columns [closed]
- Get mixed category random posts
- Using wp_list_categories like the the_category (showing just current categories of a post)
- Saving category to a post, before publishing the post
- Should I use posts or pages in this scenario?
- Assign category to new post via URL
- Category Page Template not Showing Posts
- How to allow users to post only in certain category and hide elements from edit page?
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- WordPress custom Query for Posts in Category display posts multiple times
- Need help with category listing!
- Prepending %category% onto default posts fails
- List all categories with featured image from post?
- Categories list into registration form
- How to make the first post in the loop be styled like a “new / featured” post?
- How can you display all sibling categories to a post?
- How to create a sub post?
- Category page when using static front page
- How to create a “latest news” page showing a list of posts from blog category
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post
- how to hide empty fields of post category description?
- How to have more than one page for your posts if you have 8 posts but can store max 4 on a page
- Extract wordpress posts content and category content
- All categories displays the same posts
- Having pages after specifying post_type post
- In what context should Categories and Tags be used
- list posts from two categories on a page – plugin not working
- Get latest post from categories
- How to show a featured image inside a post in only 1 single category
- Highlighting Current Category in the Archive and Feeds page
- Get current taxonomy and display query accordingly
- Geting error in post and category [closed]
- Display most recent posts in category with Twenty Ten theme widget
- Rewriting blog permalinks
- Display a specific category in a focused area of my site
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- I want to add the 10 most recent posts under a parent category on the main menu
- how to filter posts by category without page load (ajax) in wordpress?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Create/Set Category as Title of Post
- How to display related post from same category in single.php
- WordPress the_category(); only works with message-posts not with project posts, how do I specify project categories?
- Save All Post Permalink From A Specific Category into a .txt file
- I want to show recent post according to category of the post in single.php?
- show image gallery in archives or category page
- Page with Category Returning 1
- get current index of post content in category page
- Category and Posts in front page
- Get 5 most recent categories
- Nothing appears using get_the_excerpt() in category.php
- Add category information beneath post?
- Custom plugin to get related posts by category
- Unable to uncheck a category in a post
- Next/Prev category post in same button
- Newly created category does not show category
- Show category post with excerpt text
- How to show different categories in different pages?
- How to pass multiple checkbox values to wordpress query?
- How to set a link to custom archieve page
- Show a Category Specific Info Box
- Older entries link within a category page
- Display the first post’s comments of category in comments.php template
- How to filter categories of a post
- how to style an individual page in a category [duplicate]
- each user having category with their name and can add sub categories post in that category
- Can’t assign another category other than Uncategorized int he following front end post submission form?
- exclude certain categories from posts
- List posts related to category on a div [closed]
- how to show all post with its contents
- How to display my categories in a list (to a post, not the sidebar)?
- How to make category for word post_content