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 :


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


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: