Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

para la sidebar

muestra los post randomizados de a 6

// WP_Query arguments
$args = array (
	'post_type'              => array( 'post' ),
	'nopaging'               => true,
	'posts_per_page'         => '6',
	'orderby'                => 'rand',
);

// The Query
$entradas = new WP_Query( $args );

// The Loop
if ( $entradas->have_posts() ) {
	while ( $entradas->have_posts() ) {
		$entradas->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();