Posted By

cld23 on 11/06/14


Tagged

wordpress id Parent


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

rad73
tryan326


get parent id wordpress


 / Published in: PHP
 

Get parent id of a category in the category template

  1. <?php
  2. //get parent id
  3. $current_cat_id = get_query_var('cat');
  4. $child = get_category($current_cat_id);
  5. $parent = $child->parent;
  6. //
  7. ?>

Report this snippet  

You need to login to post a comment.