Skip to content

Instantly share code, notes, and snippets.

@chelmertz
Created August 30, 2011 19:46
Show Gist options
  • Save chelmertz/1181828 to your computer and use it in GitHub Desktop.
Save chelmertz/1181828 to your computer and use it in GitHub Desktop.
tags for wp post
set @post_id = 587;
select t.term_id, t.name, t.slug
from terms as t
inner join term_taxonomy as tt
on tt.term_id = t.term_id
and taxonomy = 'post_tag'
where tt.term_id in (
select term_taxonomy_id from term_relationships where object_id = @post_id
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment