exclude tag from query
-
I’m trying to exclude a tag from a query.
I have this:
<?php $events_query = new WP_Query(array( 'post_type' => 'event', 'tag__not_in'=> array(196), 'orderby'=> 'eventstart', 'order'=>'DESC' )); while ( $events_query->have_posts() ) : $events_query->the_post(); ?> ... <?php wp_reset_postdata(); endwhile; ?>But it’s not excluding the posts within tag ID 196. What am I doing wrong..?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘exclude tag from query’ is closed to new replies.