1

I am running an artist feature blog where I do interview artists from different countries and post some travel stuff from different countries.

I've set up a Custom Taxonomy called "Artist Name". This is only used on Interviews. The parent categories are different countries (Germany, US, France, China, etc.), the child categories are cities. I use categories on all posts (interviews and travel stuff).

I made a statistics page template where I want to show the total number of countries where my interviewees are from. In addition, I want to show the total number of countries where I've traveled to.

  1. Is it possible to get the total number of all PARENT categories of posts that use that custom taxonomy?
  2. Is it possible to get the total number of all PARENT categories of posts that do NOT use that custom taxonomy (e.g. when Artist Name is blank)?

I already tried to use some code snippets I found including:

count(get_categories('parent=0&hide_empty=0')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.