Categories are stored in an array as there can be more than 1.
You will need something like this:
$post_type = $post->post_type;
$post_type_data = get_post_type_object( $post_type );
$post_type_slug = $post_type_data->rewrite['slug'];
$post_tax = $post_type."category";
$post_cats = $post->$post_tax;
$cats_arr = array_filter(explode(",", $post_cats));
foreach($cats_arr as $cat){
$term_arr = get_term( $cat, $post_tax);
$term_url = get_term_link( intval($cat), $post_tax );
echo '<a href="'.$term_url.'">';
echo '<span class="cat-link">'.$term_arr->name.'</span>';
echo '</a>';
I haven’t tested it, so I’m not 100% sure it will work. I know for sure this works in detail page.
Just FYI, for most fields, if you declared the global $post variable, you can get the data like this:
$post->post_city
$post->post_region
$post->post_country
and so on…
Let us know how you went,
Thanks