Support » Fixing WordPress » Listing subcategories with special conditions

  • I need to get the list of subcategories in a similar way like in Listing sub-categories and descriptions automatically, but showing only the categories that contains posts belonging to an specific category.

    This is because to add geolocation to the posts, I´m using the categories in the way Province > City > Area, and I want to get the subcategories of an specific category, but only those with posts including also a category that represents a city.

    I also need to know the number of posts, I cannot use the value saved in count in wp_term_taxonomy.

    Can anyone help me with the SQL query?


  • The topic ‘Listing subcategories with special conditions’ is closed to new replies.