Filter out custom taxonomy term on home page loop
-
What I want to do is remove any post from my front page loop that has a certain term in my custom taxonomy. Here is the code that I am trying to get to work:
<?php $taxargs = array('tax_query' => array(array('taxonomy' => 'Models','field' => 'slug','terms' => 'model-accessories','operator' => 'NOT IN',))); ?> <?php $recent = new WP_Query($taxargs."&cat=".get_theme_mod('featured_top_left')."&showposts=".get_theme_mod('featured_top_left_num')); while($recent->have_posts()) : $recent->the_post();?>
Thankfully there aren’t any Syntax errors anymore that cause my front page to show an error and not load, but it still isn’t working. Are all of my tax_query variables right? I tried taking out the
."&cat=".get_theme_mod('featured_top_left')
to see if they were having issues with being together, but that didn’t affect it in any way. I am still seeing posts marked with the ‘Accessories’ term plus all other terms in under the ‘Models’ taxonomy. Can anyone help out?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Filter out custom taxonomy term on home page loop’ is closed to new replies.