Get the categories queried in category page to display name and description

Hello I'm using a plugin called search and filter in wordpress. Once I select 2 categories at the same time it redirects me to the category page showing me all the posts that contain either of the categories selected. I'm currently using $category = get_queried_object(); to retrieve the categories shown , but I can only echo the first category, and the rest selected are not displayed. I want to display the name and the description for each category queried.

I think it might be something like $category = get_queried_object(); getting an array, and then for each element in this array (the categories queried), print their name and description.

Has anyone ever done something similar?

Thank you !!

Read more here:

Content Attribution

This content was originally published by Matoko93 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: