Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Random Quote

Display a random quote, from “Quotes” post-type.

// WP_Query arguments
$args = array (
	'post_type'              => array( 'quotes' ),
	'posts_per_page'         => '1',
	'orderby'                => 'rand',
);

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