The problem is, there might be 1, 2, 3, 4 or N levels of depth in the subcategories. So, writing the query is possible, but inefficient because to be this flexible, left joins will be required which are not fast.
Related Posts:
- Get terms of posts with category with sql
- How to Query Database for posts with certain Taxonomy Term
- Sorting taxonomy columns by meta value numeric
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- Return terms from multiple taxonomies using $wpdb
- How to get product order by two custom taxonomy in wordpress
- wordpress mysql / wpdb ajax load more for terms help
- Get child product categories from parent product category for CUSTOM TAXONOMY archive page
- How to get related taxonomies based on a category with mysql query?
- Pull data from MySQL and add it to terms
- Unknown column ‘wp_posts.ID’ in ‘field list
- How to make an sql query to exclude everything but custom taxonomy terms in table wp_terms?
- How to permanently delete a taxonomy
- Returning info from MYSQL table via custom taxonomy
- How to use taxonomies on attachments with the new Media Library?
- Hierarchical taxonomy UI
- Filtering custom taxonomies
- Allowing specific users to only add posts using certain custom taxomy terms
- Edit tags page for hierarchical taxonomy doesn’t show taxonomies at all depths
- I want to load post content by categories using Ajax
- Get only the first term by taxonomy
- Hook to process a new taxonomy tag before it is created?
- Removing taxonomy base using WP rewrite
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- WP_insert_term how to insert multiple values as taxonomny term?
- How to include parent terms in hierarchical taxonomy URLs?
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Custom taxonomy term as class?
- How to edit/remove a term that’s in multiple taxonomies?
- Fix : Custom Taxonomy Duplicating in each call
- Text and image in taxonomy page
- Custom taxonomies
- Improving WP_Query performance for multiple taxonomies
- Create Child Taxonomies
- How to add custom field to custom taxonomy in 4.4
- Operations with custom fields values in a loop
- How to insert an array of terms using wp_insert_term?
- Create Advanced search with taxonomies (not filter list)
- Show nav link highlighted
- How to get custom post type taxonomy
- display taxonomy slug from term ID
- remove sanitize_title() for register_taxonomy()
- Redirect all child taxonomy to its parent
- How to add taxonomy to user?
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- has_term if/echo else/echo function
- Taxonomy Order by Name
- add hirarchy of categories in products grid of visual composer
- taxonomy tax-name archive
- Widget dropdown always displays first option
- Adding custom taxonomy in my existing category URL
- Custom Taxonomy Tag Cloud?
- Make child taxonomy categories use a set template
- Copy/clone/associate Custom field to Custom Taxonomy
- Query posts using custom taxonomy and selected terms
- Foreach loop duplicating a taxonomy thumbnail image
- Load a certain functions file for a certain taxonomy
- one post per term taxonomy
- Custom permalink accept any params
- Terms change id after importing
- How do I get the labels from a post
- Hide custom taxonomy from easy admin
- Add file attachments/meta to a custom Taxonomy
- Displaying user selected custom tags/taxonomies on the front-end
- how to use tax_query to apply both terms or one if one is empty
- Get current page term title to use in WP_Query
- Running a function only once when a taxonomy term is changed
- making an index from custom taxonomies and tags of posts (not hierarchical taxonomy)
- Displaying my custom taxonomies in a using the_term_list()
- Using Custom Taxonomies to organise products – struggling to call a correct list
- Use wp_list_categories to list parent categories from actual term
- is there a way of getting term children that only shows those from two taxonomies
- Wp_insert_term doesn’t work from separate file with custom taxonomy
- How to create filter’s for custom taxonomy page
- How to create a non removable taxonomy term?
- How to show category list in WordPress
- Query by multiple custom taxonomies
- get the custom taxonomy name?
- transfer two existing taxonomy terms into one custom metabox
- How to add all existing Custom Taxonomy to Admin Menu Creations Interface?
- Catchable fatal error: Object of class WP_Error
- Templates files for custom post type with custom tags
- Permalink structure not working with Custom Taxonomy (URL like ./taxonomy/category/postname)
- Creating a Taxonomy Page [duplicate]
- Pagination with custom query (not using posts)
- What’s the proper WordPress URL for the template of my custom taxonomy?
- WordPress show posts from children terms of a taxonomy term
- How to randomise a custom taxonomy tag cloud
- How to create a page that lists custom taxonomies with links?
- query posts returns 10 records
- How to add/enqueue Custom CSS for a custom taxonomy page?
- Make custom post type display with custom taxonomy in url
- How do I create a term for every value of a post meta?
- Custom taxonomy archive empty
- Taxonomy Child Not Updating Unless I Click Update Twice
- Adding terms to custom post type – incorrect term being applied
- Save selected terms in order of custom taxonomy in post
- How to show to show post list under the specific category name using jetengine query?
- Taxonomy entries are spawning copies of existing entries with the new title as the existing ID, since upgrade
- Replace post author in header by custom taxonomy