Last active
July 18, 2017 04:19
-
-
Save designhash/f8925b0086cec1e46da547b4e27f86dd to your computer and use it in GitHub Desktop.
Show posts from a certain taxonomy
This file contains hidden or 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 | |
$loop = new WP_Query(array( | |
'post_type' => 'ad', | |
'posts_per_page' => 4, | |
'tax_query' => array( | |
// Note: tax_query expects an array of arrays! | |
array( | |
'taxonomy' => 'type', // my guess | |
'field' => 'slug', | |
'terms' => 'business', | |
), | |
), | |
)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment