Did you try WP_Query? Using my knowledge and the WP_Query documentation, I did this:
$args = array(
'post_type' => 'my_post_type', //change the post type here
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'my_category', //change the taxonomy name here
'field' => 'id',
'include_children' => false,
'terms' => 10 //change the term id here
)
)
);
$_query = new WP_Query($args);
if ($_query->have_posts()):
while ($_query->have_posts()):
$_query->the_post();
//do something here the_title() etc
endwhile;
endif;
wp_reset_query();
The magic should come from the include_children
attribute. Test it out 🙂
Is this what you wanted?
Related Posts:
- Is it possible to have an index page for taxonomy term for each custom post type it is assigned to?
- How to get_queried_object on multiple objects?
- Custom Post Type / Taxonomy Slug / Post Title with post type archive
- Hide child term posts on parent term pages
- Posts per Page on custom Taxonomy Template
- Post type archive page not working
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Archive page for taxonomy of custom post type
- Should I change these content meta types before building complex archive page?
- Getting taxonomy terms used by custom post type
- Archive or taxonomy pages not working for custom post type
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- How to create archive page for taxonomy terms within custom post type
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- taxonomy template for custom post type the same as the archive
- How can I filter by taxonomy on a custom post type’s page?
- Custom template won’t load for a custom post type (custom permalinks used)
- Custom post type templating problem
- Create template for taxonomy results limited by Custom Post Type
- Extending AZIndex plugin to use custom post types and custom taxonomies
- Use Custom Post Type archive page for the taxonomies term archive page
- Display custom post type category, while in a CPT category, then the posts beneath
- Number of Custom Post Types published are not being shown in the custom page
- posttype/taxonomy/term archive page 404 error
- Custom Post Archive is not working
- What’s the name of the custom post type yearly archive template?
- Alphabetically sort a taxonomy.php template by post title
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- Permalink problems with custom post type and custom taxonomy
- sort CPT on Custom Taxonomy Archive page
- Use the custom post type archive for taxonomies?
- Custom Post type date archive for custom taxonomy
- Show categories of custom post type and not all posts
- Query Posts that have Custom Taxonomy
- Custom Post Type Custom Archive Page Not Working
- Getting custom taxonomy posts on archive page
- Archive page for custom post type and custom taxonomy
- Custom post type category permalinks and archive pages
- Displaying custom taxonomy menu in custom post type archive
- Archive page of CPT’s custom Taxonomy
- Getting Same Description in All the Custom Taxonomy Posts
- Displaying all posts by category and showing content on click
- pagination problem listing custom post types of taxonomy in wordpress
- Posts per Page on custom Taxonomy Template
- Static Front Page not working for custom theme
- Building Link List for Custom Tax
- Custom taxonomy with custom post type archive page
- Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?
- Custom post type post_type_link gives “page not found” on any other custom post type
- Custome post type “tags” pick default archive instead of custom post type archive
- Customize url from the_terms
- Custom post types not displaying per category
- Help with Multi Level Category Archive Page
- Custom post type archive page not showing on archive-posttype.php
- Custom taxonomy in custom post type archive with pagination
- Pagination fault in custom post type archive page [duplicate]
- Why is this custom post type defaulting to archive.php?
- title tag for custom post type remove taxonomy name from title tag
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Custom taxonomy archive page not routing?
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Combining Multiple Taxonomies in one URL
- ‘No pages found’ in Dashboard after registering custom taxonomy
- How to display recent posts added in custom post types
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Permalinks when filtering multiple custom post types by single taxonomy
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- Podcast Guest List
- Update post terms with custom taxonomy
- Displaying Page as Custom Post type landing Page
- Get custom post type list for every category shortcode
- Listing tags from a custom post type
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- How do I display the taxonomy term alongside the post type post title?
- Custom Post, set object Taxonomy terms in plugin
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- Get parent category(taxonomy) ID from single template of a custom post type
- Dynamic CPT / Taxonomy
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Get custom term meta problem on single post type
- Different structure/content for posts from a custom post type
- Custom Post Type URL Rewrite’s
- Add term for custom taxonomy from front end
- Custom Taxonomy Filter Issues
- CPT archive page – show one post from each taxonomy term
- How do I make a request in my browser to search the CPT taxonomy?
- Archive page of taxonomy returns a 404 error
- Get dropdown child categories from parent category of custom post type
- I want to create a metabox under custom taxonomy
- Set different posts_per_page for custom post type/taxonomy
- Creating adminable dynamic filtering on custom post type
- WP_Query for CPT with filter by another WP_Query
- Get posts in same category not working
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Custom Post Type urls not working
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu