Site icon Anthony Carbon

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
Exit mobile version