Category nicename inside loop in wordpress
You can use get_the_category inside the loop to get the category/ies a post is assigned to. To get a list of available member variables available, see get_categories. I would suggest to target the first category only, which will also be the parent category if the post is assigned to only one parent and some of … Read more