Assuming you want to keep the WP_Query exactly the same there’s 2 ways I can think of which you could do this using various loops.
1) Grab the first post from the posts
Array.
WP_Query has a bunch of properties and methods one of which is the posts
array.
if( $the_query->have_posts() ) {
// Grab the first post object
$single_post = $the_query->posts[0]; // $post is reserved by global.
// This only gives you access to object properties, not `the_*()` functions.
echo $singe_post->post_title;
}
// Overwrite the global $post object
if( $the_query->have_posts() ) {
// Grab the global post
global $post;
$post = $the_query->posts[0]; // Grab the first post object.
setup_postdata( $post ); // Allows you to use `the_*()` functions. Overwrites global $post
the_title();
// Reset global $post back to original state
wp_reset_postdata();
}
2) Rewind the query when necessary.
The following will loop through the loop as normal but at the end we’ll rewind it. This ensures that should we want to loop through all the posts, it will include the first post. This method uses WP_Query::rewind_posts
if( $the_query->have_posts() ) {
while( $the_query->have_posts() ) {
$the_query->the_post();
// Break out of the loop after displaying 1 post.
if( $the_query->current_post >= 1 ) {
break;
}
the_title();
}
// Rewind the posts back to index 0, or the beginning.
$the_query->rewind_posts();
// Always call after running a secondary query loop that uses `the_post()`
the_query->wp_reset_postdata();
}