Display only the primary category when a post belongs to several categories

Hello again Movin,

I’m having an issue with the categories (see the attached screenshot) :

My blog post’s primary category is “Île Maurice”, but the post belongs to both the “Île Maurice” child category and its parent category, “Destinations”.

Yet, when I browse the website, only the parent category is displayed above the post, though it wasn’t defined as the post’s primary category.

Can you help me make only the primary category visible ?

Is there any way to do the same in the homepage’s slider ? (i.e. not show multiple categories but only the primary category)

Thanks and keep up the good work !

Hi @loveandgoingplaces,

I hope you are well today and thank you for your question.

Could you please try achieving this by using the custom code solution posted in the following topic?

https://colorlibsupport.com/t/category-above-post-varies/#post-51548

Best Regards,
Movin