Skip to content

Instantly share code, notes, and snippets.

@matheusgimenez
Last active August 29, 2015 14:08
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 matheusgimenez/e4ac315e788b50d672b5 to your computer and use it in GitHub Desktop.
Save matheusgimenez/e4ac315e788b50d672b5 to your computer and use it in GitHub Desktop.
<?php
// WP_Query arguments
$args = array (
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array('tutoriais', 'destaque'),
),
),
);
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
// coloca o codigo do loop aqui
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment