Get current posts parent category ID, permalink, name, etc via codes below.
$ac_category = get_the_category( get_the_ID() ); // Use print_r($ac_category); to see all data. It includes name, slug, etc. echo esc_url( get_category_link( $ac_category[0]->term_id ) ); // this will show a category permalink
Leave a Reply