wordpress php query randomise
- Use the
WP_Query
class to create a new query for posts in WordPress. - Set the
orderby
parameter to "rand" to randomize the order of the posts. - Retrieve the posts using the
get_posts()
method or a custom loop. - Loop through the randomized posts to display them on the web page.