I'm trying to output the current post categories for my 'portfolio' custom post type as a shortcode.
At the moment I have this snippet in the functions.php
function shows_cats(){
$page_id = get_queried_object_id();
echo '<h6>Categories</h6>';
echo get_the_category_list('','',$page_id);
}
add_shortcode('showscats','shows_cats');
I've tried a few different combinations to call the CPT but have had no luck. I realise that this snippet is just outputting standard WP categories but was wondering if anyone knew a way to edit this to display the CTP instead.
Many thanks for your help