Vishmax.com
Read

How to display random blog post on WordPress

We design and develop websites, digital experiences, and software solutions for growing businesses.

Add below code to your WordPress theme and it will display posts on random wise. You need to edit the category in below code according to your need.

 
	<?php 
		query_posts('showposts=10&cat=5&orderby=rand');
		while ( have_posts() ) : the_post(); 
	?>	
 
		<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
			<h2><?php the_title(); ?></h2>
		 </a>		
		<?php the_excerpt();?>
 
	<?php endwhile; ?>