Skip to content

Instantly share code, notes, and snippets.

@azeemhassni
Created June 20, 2014 14:12
Show Gist options
  • Save azeemhassni/3293637cf145871c31b0 to your computer and use it in GitHub Desktop.
Save azeemhassni/3293637cf145871c31b0 to your computer and use it in GitHub Desktop.
Wordpress Filter Posts
SELECT p.* FROM knr_posts p, knr_term_taxonomy tt, knr_term_relationships tr
WHERE p.ID=tr.`object_id`
AND tt.`term_id`=tr.`term_taxonomy_id`
AND (p.post_type = 'recipe_cpt' OR
AND p.post_status = 'publish'
AND tt.`term_taxonomy_id`=7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment