Second loop showing posts from main query
-
I am trying to show the featured posts in my theme, with a custom field mytheme_featured_post which is 1 on the featured posts.
However it does not seem to filter the posts down to only the posts in the meta query.
// WP_Query arguments. $featured = array( 'posts_per_page' => '5', 'meta_query' => array( array( 'key' => 'mytheme_featured_post', 'value' => '1', ), ), ); // The Query. $featured_query = new WP_Query( $featured ); if ( $featured_query -> have_posts() ) { while ( $featured_query -> have_posts() ) : $featured_query -> the_post(); the_title(); endwhile; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Second loop showing posts from main query’ is closed to new replies.