0
votes

I have a cutom post type named : art_design and i have a taxonomy called artdesign_mainslider, in one loop i have only posts from the taxonomy artdesign_mainslider and in the other loop i have posts from custom post type art_design but i want to exclude the taxonomy ?

1st loop:

<?php
$args = array( 'artdesign_mainslider' => 'art-design-featured-post', 'posts_per_page' => 5 );$loop = new WP_Query( $args );while ( $loop->have_posts() ) : $loop->the_post();  ?><?php endwhile; ?>

2nd loop ( i want to exclude artdesign_mainslider):

<?php
$args = array( 'post_type' => 'art_design', 'posts_per_page' => 10, );$loop = new WP_Query( $args );while ( $loop->have_posts() ) : $loop->the_post();  ?><?php endwhile; ?>
1

1 Answers

0
votes

You have to use the tax_query parameter. See http://www.wpexplorer.com/exclude-taxonomy-wordpress/ for a perfect example of what you're trying to do and http://codex.wordpress.org/Class_Reference/WP_Query for the reference for tax_query.