You’ve added the filter lm_exclude_bio
to pre_get_posts
. So when you need to run another query you can remove the filter to get normal query. You can remove the filter like below-
// Here we're removing the filter first. Then we are running the query.
remove_filter( 'pre_get_posts', 'lm_exclude_bio' );
$args = array( 'post_type' => 'bio', 'posts_per_page' => 1 );
// My second query for CPT 'bio'
$bio_query = new WP_Query( $args );
// The Loop
if ( $bio_query->have_posts() ) {
while ( $bio_query->have_posts() ) {
$bio_query->the_post();
// please, my custom post 'bio' !...
}
/* Restore original Post Data */
wp_reset_postdata();
} else {
// no posts found
}
?>
Also in while ( $the_query->have_posts() )
you got a error on $the_query
. It would be $bio_query
. I’ve fixed the error in my above code.
Hope it helps.