Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. $category=get_the_category();
  2. $parent_id = $category[0]->cat_ID;
  3.  
  4. foreach($category as $childcat)
  5. {
  6. if (cat_is_ancestor_of($parent_id, $childcat))
  7. {
  8. echo $childcat->cat_name;
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement