Created
July 24, 2019 03:02
-
-
Save adamrosloniec/7449ec85245460d65bd3d967f6a02f6d to your computer and use it in GitHub Desktop.
WordPress - Get all posts with 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
get_posts(array( | |
'posts_per_page' => -1, | |
'post_parent' => 0, | |
'post_type' => 'sanctuary', // post type slug | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'territory', // taxonomy slug | |
'operator' => 'EXISTS' | |
), | |
), | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment