Trying to retrieve random post, getting a page
You need to specify the post type to be a post – try this for your $args instead: $args = array( ‘post_type’ => ‘post’, // Specifying you want posts only ‘posts_per_page’ => 1, ‘orderby’ => ‘rand’, ‘post_status’ => ‘publish’, ); And most importantly, you need to apply the $args to your query, so do this … Read more