Get the current post parent category ID

How to get the current post parent category ID? Just copy the codes below and paste this your template.

global $post;
$category = get_the_category( get_the_ID() );   
$parent = $category[0]->term_id

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *