wordpress php query randomise

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