I'm trying to set up a search page that first shows a Loop with all posts with a Custom Field meta_key of 'seek_premium' where it's meta_value is 'yes', and then a second Loop where the meta_value (same meta_key) is empty. I've got it working for the most part, but the way I'm doing it seems to break the default search functionality, in that if I do a search, no matter if a post contains the search query or not, I end up seeing all posts marked as "seek_premium" in the first loop, and all posts where "seek_premium" is empty in the second. Here's my code:
<?php if ( have_posts() ) : ?>
<h1>My Heading</h1>
<?php
$premium_query = new WP_Query( array( 'meta_key' => 'seek_premium', 'meta_value' => 'yes' ) );
while ( $premium_query->have_posts() ) : $premium_query->the_post();
$seekpremium = get_post_meta( $post->ID, 'seek_premium', true );
?>
SHOW PREMIUM POSTS
<?php endwhile; ?>
<?php
$free_query = new WP_Query( 'post_per_page=50' );
while ( $free_query->have_posts() ) : $free_query->the_post();
$seekpremium = get_post_meta( $post->ID, 'seek_premium', true );
if ( !empty( $seekpremium ) )
continue;
?>
SHOW FREE POSTS
<?php endwhile; ?>
<?php else : ?>
<?php include ( TEMPLATEPATH . "/unknown.php" ); ?>
<?php endif; ?>
Anyone have any ideas? I'd seen something about using $is_search as a parameter, but either am not implementing it correctly or something else with my query is wrong...