Last active
August 29, 2015 13:55
-
-
Save db-roberto/8710691 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* HOW TO WRITE A TAX QUERY | |
* ******************************************************/ | |
$query_args = array( | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'custom-taxonomy', // name of the taxonomy | |
'field' => 'slug', // what field is being queried (can be slug or id) | |
'terms' => 'hostingadvice-com' // the slug to match | |
), | |
), | |
); | |
$query = new WP_Query( $query_args ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment