New answers tagged advanced-taxonomy-queries
If I'm understanding you correctly get_term_children does what you want. $term_id = 2; $tax_name = 'locations'; $term_child = get_term_children( $term_id, $tax_name ); Another possibility would be using get_categories, it has an child_of, taxonomy and depth parameter - the documentation on wp_list_categories, which offers pretty much the same ...
For a Category landing page that only shows each 'product_cat' image that links to a separate page for each category, I have the following template enclosed. It doesn't use $term->term_taxonomy_id but rather $term->term_id. Not sure if it will help, but look it over for differences from what you have. <?php /** * Product taxonomy template */ ...
Retrieval of multiple posts in WordPress is almost always handled by WP_Query class (or get_posts() function that wraps it). There is quite a lot of documentation and information to it, but to narrowing it down to your specific case you will need to: set up posts loop for each term pass as arguments to each loop: your post type desired number of posts ...
The pre_get_posts filter is immediately before the loop begins in taxonomy-services.php That is too late. The main query runs long before your template loads. Move your pre_get_posts filter to your theme's functions.php, or a plugin or MU-Plugin file, and you should see the difference.
Top 50 recent answers are included