Render post categories
<h5 class="category">
<?php
foreach((get_the_category()) as $category) :
//category name
$category_name = $category->cat_name;
// Get the ID of a given category
$category_id = get_cat_ID( $category_name );
// Get the URL of this category
$category_link = get_category_link( $category_id );
?>
<a href="<?php echo esc_url( get_category_link( $category_id ) ); ?>"><?php echo $category_name; ?></a>
<?php endforeach; ?>
</h5>