This question has different answers in this specific WordPress question, they may be of help:
Display all posts in a custom post type, grouped by a custom taxonomy
Personally I used this method that worked for me just fine:
$terms = get_terms('tax_name');
$posts = array();
foreach ( $terms as $term ) {
$posts[$term->name] = get_posts(array( 'posts_per_page' => -1, 'post_type' => 'post_type', 'tax_name' => $term->name ));
}
Editing it to your scenario this should work:
$terms = get_terms('producer');
$posts = array();
foreach ( $terms as $term ) {
$posts[$term->name] = get_posts(array( 'posts_per_page' => -1, 'post_type' => 'movie', 'tax_name' => $term->name ));
}
Now you can get your posts:
print_r($posts["WarnerBros"]);
Related Posts:
- Custom Comment Types
- Not Able to Insert Taxonomy Term Using wp_insert_post()
- Restrict taxonomy dropdown to post type
- array_pop() expects array, boolean given for $event_type_term ->slug
- Get template part based on custom taxonomy term
- WordPress returns 404 on custom rewrite rule conflict in parameters
- Conditional two level dropdown filter for custom post type
- Show all custom post type posts sorted by custom taxonomy then by another custom taxonomy
- Custom Post Type Category List & Post Count
- Custom taxonomy archive page not working
- Custom edit post column – category not showing
- How to show multiple post types on taxonomy archive?
- Custom post type / custom fields
- using custom taxonomies on non wp table?
- Custom Taxonomy Not Showing Up on Post Page
- Custom permalink – append taxonomy name and term name at the end of permalink
- Get the posttype of a taxonomy/term
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Add hierarchical taxonomy to permalink for custom post type
- How to get posts from multiple custom post types according to it’s custom taxonomy terms?
- get_template_part for each level of taxonomy term
- Displaying a custom post types custom taxonomy value?
- Podcast Guest List
- custom permalinks based on taxonomies for custom post type
- Update post terms with custom taxonomy
- Deleting Custom Taxonomy Term only increments tag_ID
- Get custom post type list for every category shortcode
- Custom Post Type Taxonomy Filters
- Listing tags from a custom post type
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- 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?
- Get related posts of child term of custom post type
- Filter term taxonomy metabox in custom post type
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- Custom Post, set object Taxonomy terms in plugin
- Hierarchy and access control for Custom Post Types (CPT)
- Different Category system needed for the Custom Post Type
- single-{post_type}.php not working
- WordPress wp_query() basic question about args
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- How to add current custom taxonomy slug to body class
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- How to define a term for custom taxonomy
- Exclude posts with custom taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Get parent category(taxonomy) ID from single template of a custom post type
- Dynamic CPT / Taxonomy
- How to approach a site where it has sub-businesses, each with its own pages (“articles”, “staff”)? Don’t want to use WP multisite
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- 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
- Creating custom post type posts and associating them with a post from another custom post type
- Different structure/content for posts from a custom post type
- Custom Post Type View Button in Admin Gives 400 Error
- Custom Post Type URL Rewrite’s
- Add term for custom taxonomy from front end
- Custom Taxonomy Filter Issues
- how to organize my categories or should I do custom post types for some?
- How do i display post from a taxonomy term?
- Multiple permalinks for a single post with multiple taxonomies
- rewrite rules hierarchical
- either single-{custom}.php 404’s OR /taxonomy/ 404’s – custom post type and taxonomy permalinks
- How do I make a request in my browser to search the CPT taxonomy?
- Archive page of taxonomy returns a 404 error
- update custom taxonomy custom fields
- Get dropdown child categories from parent category of custom post type
- How do you create pillar content pages?
- How to display “META” array in register_taxonomy
- If ACF Post Object post has custom taxonomy term…
- I want to create a metabox under custom taxonomy
- Customise Permalink Structure For Custom Post Types
- How to filter taxonomy of a custom post type and display it in the single post type page in the back end?
- Parent and child categories with their id in drop_down in CPT
- CPT/Taxonomy/Postname permalink structure makes pagination break
- Set different posts_per_page for custom post type/taxonomy
- Custom Taxonomy not working front side Woocommerce
- Custom post type post_type_link gives “page not found” on any other custom post type
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Taxonomy’s title
- Display all posts from single taxonomy term
- Creating adminable dynamic filtering on custom post type
- Best way to use Category & Custom Fields?
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- WP_Query for CPT with filter by another WP_Query
- Get posts in same category not working
- Heirarchical URLs with CPT and custom taxonomy
- Displaying taxonomies with manage_{custom-post-type}_posts_custom_column
- Plugin Error on activating
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Paginate custom taxonomy category with wp_custom_pagination
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Custom Taxonomy Showing in WP Menu
- Storing/querying custom date data
- Custom Template Taxonomy
- How to relate one custom post type to another custom post type
- Links in archive not including taxonomy parameter
- Dynamically count the number of custom post types associated to a custom taxonomy