Skip to content

Instantly share code, notes, and snippets.

@IgnacioGaldames
Last active April 26, 2016 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IgnacioGaldames/b7aa3e234939e3b32b4e to your computer and use it in GitHub Desktop.
Save IgnacioGaldames/b7aa3e234939e3b32b4e to your computer and use it in GitHub Desktop.
exclude custom taxonomy
<?php
$args = array(
'post_type'=>'casas',
'posts_per_page'=>4,
'orderby'=>'date',
'order'=>'DESC',
'tax_query' => array(
array(
'taxonomy'=>'categorias_casas',
'field' => 'slug',
'terms' => array( 'agenda' ),
'operator' => 'NOT IN',
),
)
);
$query = new WP_Query( $args);
?>
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment