Last active
October 9, 2019 09:54
-
-
Save Robzelf/ed8709a5e0d8a7a4fd6ac7ca190b1088 to your computer and use it in GitHub Desktop.
Wordpress: Filter by custom taxonomy & custom field
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
$_args = array ( | |
'post_type' => %post_type%, | |
'tax_query' => array ( | |
array ( 'taxonomy' => %tax_name%, 'field'=> 'term_id', 'terms' => %term_id% ), | |
), | |
'meta_query' => array ( | |
array ( 'key' => %custom_field%, 'value'=> %value%, 'compare' => '=' ), | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment