mardi 18 avril 2017

Check if WordPress post has a specific category

A WordPress website has this structure:

TopCat1 > subcat > post

TopCat2 > subcat > post

TopCat3 > subcat > post

What is the PHP code to show the word checked only if current post has a specific top level category named "TopCat2"? It doesn't mind if it's inside a subcategory or not.

Aucun commentaire:

Enregistrer un commentaire