I use get_the_category_list
to create a cat link in the header of my posts in the archive page, like so :
$categories_list = get_the_category_list( esc_html__( ', ', 'mytheme' ) );
if ( $categories_list ) {
echo '<div class="cat-links">';
get_template_part('images/inline', 'picto-actu.svg');
$categories_list . '</div>';
}
I am trying to include the parent category to show it like so on the frontend :
parent category > the category
. But I'm probably not using the right method because whatever i try, i can't seem to get the parent, i can't even get the id of the child category from $categories_list
, which would help me find the parent...
echo $categories_list . '</div>'
;