/ Published in: PHP
Get parent id of a category in the category template
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php //get parent id $current_cat_id = get_query_var('cat'); $child = get_category($current_cat_id); $parent = $child->parent; // ?>