Created
June 2, 2012 19:59
-
-
Save brianium/2859761 to your computer and use it in GitHub Desktop.
sermon query for custom wordpress
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
SELECT DISTINCT p.ID | |
FROM wp_posts p | |
LEFT JOIN wp_term_relationships tr ON tr.object_id = p.ID | |
LEFT JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_id | |
LEFT JOIN wp_terms t ON tt.term_id = t.term_id | |
WHERE p.post_type = "sermon" | |
AND p.post_status = "publish" | |
ORDER BY p.ID ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment