WP_query Pulling wrong post type
-
In the lower right corner of this page is a box labeled “Proclamations & Resolutions” that displays resolutions of support communities have passed.
https://www.aviationacrossamerica.com/state-local-activity/state-activity-texas/
The code that pulls that is:
<?php $args = array( 'post_type' => array ('proclamation'), 'tag' => 'texas', 'posts_per_page' => 100, 'orderby' => 'date', 'order' => 'desc', ); $procposts = new WP_query ($args); if ( $procposts->have_posts() ) : while ( $procposts->have_posts() ) : $procposts->the_post(); ?> <option value="<? echo the_permalink(); ?>"><?php the_title(); ?></option> <?php endwhile; endif; ?>
But for some reason WP_query is also pulling in posts from the post_type “tribe_events” that are tagged with Texas.
I thought it was a problem with it pulling the events because they share the tag, but we have ten or so different custom post types that are also tagged Texas and not getting pulled in. It’s specific to the tribe_events post type.
Any ideas why limiting the loop to proclamations isn’t filtering out the tribe_event type?
- The topic ‘WP_query Pulling wrong post type’ is closed to new replies.