Return to Snippet

Revision: 67952
at November 6, 2014 02:36 by cld23


Initial Code
<?php
//get parent id
$current_cat_id = get_query_var('cat');
$child = get_category($current_cat_id);
$parent = $child->parent;
//
?>

Initial URL

                                

Initial Description
Get parent id of a category in the category template

Initial Title
get parent id wordpress

Initial Tags
wordpress

Initial Language
PHP