Created
July 16, 2018 19:26
-
-
Save ksaylor11/c42c9c80eb912f6db4c01d261baccfe8 to your computer and use it in GitHub Desktop.
finds all WordPress posts in category
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
SELECT | |
posts.ID, posts.post_title | |
FROM | |
wp.posts AS posts | |
INNER JOIN | |
wp.term_relationships AS rel ON posts.ID = rel.object_id | |
INNER JOIN | |
wp.term_taxonomy AS tax ON tax.term_taxonomy_id = rel.term_taxonomy_id | |
WHERE | |
tax.term_id = 17 AND post_type = 'post' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment