Secondary Query Is Breaking Main Query
you don’t need to call wp_reset_postdata() for get_posts() because it does not actually modify global variable $wp_query. $posts though is a global variable used by WordPress. Change that to a new name and what you have should work. $args = array( ‘post_type’ => ‘quote’, ‘posts_per_page’ => 1, ‘orderby’ => ‘rand’ ); $quote_posts = get_posts( $args … Read more