Always get parent category name WordPress

enter image description here

I just would like to get and display the parent (or grand parent if necessary) category name in WordPress.

I have this :

single_cat_title()

But it display the actual category name.

My code is in header.php

In this image, in the green part it must be written “Energies Renouvelables”

Have an idea ?

Read more here: Always get parent category name WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *