• Hey guys,

    I have an archive page for one of my taxonomies “Property Builder” (taxonomy-property-builder.php) currently using a standard loop that feeds in corresponding posts to each particular taxonomy archive (see example link below). The standard loop (if(have_posts()) : while(have_posts()) : the_post();) works fine, however I am trying to exclude the posts tagged with a specific term (‘quick-move-in’) from a different taxonomy (‘property-type’).

    See the following link to one of my builder taxonomy archive pages (Parkwood Homes). Below the copy text is the posts feed where you will see three posts. I simply need to exclude the (in this case) first post, “QUICK MOVE IN – 8405 E. 49TH DRIVE” (which is tagged as a “Quick Move In” of the “Property Type” taxonomy – https://www.stapletondenver.com/builders-in-stapleton/parkwood-homes/

    I have tried a series of things including “tax_query” (see code below) and more, only to no success.

    $the_query = new WP_Query(
    array(
      'post_type'  => 'property',
      'tax_query' => array(
        array(
            'taxonomy'  => 'property-type',
            'field'     => 'slug',
            'terms'     => 'quick-move-in',
            'operator'  => 'NOT IN')
    
            ),
       )
    );

    I know this is a very detailed description but I just want to be sure it makes sense what I am trying to do :/ All and any help is appreciated, thanks in advance!!

Viewing 1 replies (of 1 total)
  • Thread Starter aronjeney

    (@aronjeney)

    Does anyone have any insight to my post? I am still pulling my hair out over this. I am probably just over thinking it.

    I have also tried adding property-builder to my args:

    $args = array(
    		'post_type' => 'property',
    		'property-builder' => $term->slug,
    		'tax_query' => array(
    				array(
    					    'taxonomy' => 'property-type',
    	    			            'term' => array('quick-move-in'),
    					    'field' => 'slug',
    					    'operator' => 'NOT IN',
    				),
    			),
    		);
    $query = new WP_Query( $args );

    Again, would really appreciate all and any help. Please and thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘How to exclude a specific taxonomy term from taxonomy archive page’ is closed to new replies.