You may do it by this method.
$media_category = get_terms('media_category'); foreach($media_category as $cat) { wp_reset_query(); $args = array('post_type' => 'your_post_type', 'tax_query' => array( array( 'taxonomy' => 'media_category', 'field' => 'slug', 'terms' => $cat->slug, ), ), ); $loop = new WP_Query($args); if($loop->have_posts()) { // echo $cat->name; while($loop->have_posts()) : $loop->the_post(); echo get_the_title(); endwhile; } }
Related Posts:
- get_the_term_list without links in 3.1
- Custom columns on edit-tags.php main page
- get_term_children for immediate children only (not grandchildren)
- Creating a non-removable taxonomy term
- Is it possible to use one slug for Multiple Taxonomies?
- Display one post from each term in a custom taxonomy [closed]
- Is it possible to add taxonomies to user profiles?
- Get terms from multiple taxonomies
- get_terms showing link to category even if all posts are drafts
- How to restrict on selecting child taxonomy
- Is it possible to sort the post based on a custom field?
- How do I get terms as a list for a specific post?
- get taxonomy terms for parent and child
- On Taxonomy Template page, want to add Post_Type
- Separator for multiple terms
- The next_posts_link() show me a aditional page in blank
- Help building array hierarchically with taxonomies (to get posts)
- How get custom field from custom taxonomy?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Get multiple term objects by ids
- Echo custom taxonomy term name
- Next and Previous links on a single taxonomy page only link to same term
- Why does WP rename similar “term name”-slugs in separate taxonomies?
- Move terms from one taxonomy to another keeping the hierarchy
- How can I get WP to build a feed based on multiple taxonomy terms
- Getting the selected terms for custom taxonomies in the editor
- Change permalink of post if it belongs to custom taxonomy
- Set custom post type terms by id without knowing taxonomy
- How to determine the depth of a term in a custom taxonomy?
- How do I Use Multiple Loops with WP_Query?
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Catchable fatal error on custom category post
- How to add contents of a custom field to a taxonomy term list?
- Google Map Shortcode for Custom Taxonomy/Post Types
- Querying two taxonomies
- How to target parent product category and its children using WooCommerce?
- Custom taxonomy query is empty. 0 = 1 in SQL
- How do you reorder the custom taxonomies on the right side of a custom post edit page?
- Custom Taxonomies not retaining hierarchy while importing from one site to another
- What is the most efficient way of implementing a notification system? [closed]
- Remove custom taxonomy column from my custom post type columns
- Exclude taxonomy term from all loops, but having it on widget
- Get all attachments by custom taxonomy – term
- How to get custom category’s link?
- Edit custom taxonomy description programatically
- why are the term_id and term_taxonomy_id doesn’t match on custom taxonomies, but are duplicates on categories
- saving meta/custom field to tag
- Get taxonomy name for the current post
- How to get posts that contain multiple terms from multiple taxonomies?
- Cannot delete or edit a single term in a custom taxonomy, taxonomy name is wrong?
- View the complete list of a taxonomy in the navigation menu
- Correctly order the hierarchy of custom taxonomy when displaying terms
- Duplicate slug/permalink issue
- Getting taxonomies associated with a specified post type
- Changing input type from text to multi select dropdown – skill taxonomy
- How to list the taxonomy terms that fit the custom query?
- What’s the best way to add taxonomy’s image in 2017?
- Count of posts by different parameters?
- Archive page for custom taxonomy grouped by month
- Add custom taxonomy as a css class
- Wp_query…a type of term a different div
- Taxonomy page shows category in title
- Replace taxonomy term with an image in a custom loop
- Show single Child Category on Custom Post
- search using multiple taxonomies and keyword
- Need equivalent of single_term_slug
- unable to save custom taxonomy terms in a custom-built metabox in wp-admin
- How to group non-hierarchical tags?
- Multiple Drop-Down custom taxonomies search
- How to combine taxonomies into URL?
- Issue adding custom taxonomies to custom post type (PHP)
- Taxonomy URL rewrite whilst keeping filtered posts?
- Add terms to a taxonomy archive from within the same taxonomy
- Fill New Taxonomies
- How to loop custom posts that have an exact match in taxonomy terms?
- True or F False Setting of ‘with_front’ Parameter of Rewrite Is returning Exact Same result
- How do I show the parent term on a custom taxonomy template (not the ID)?
- wp_insert_post not adding taxonomy (using wp_set_object_terms)
- Filter “get_terms” query
- Display taxonomies for custom post type
- generate random slug when adding taxonomy
- Custom Taxonomy – Dropdown
- How to show selected check box vendors on front end home page?
- Error 404 in Custom taxonomy with pagination
- WordPress Taxonomy Permalinks – Custom?
- Need help understanding a rewrite with multi-level taxonomy
- custom taxonomy don’t return a value
- Attaching meta box to specific category/taxonomy in custom post type
- Change Permalink to Value of Custom Field
- Where to put a migration script to switch post information?
- Display custom post taxonomies
- Gravity prerender taxonomy [closed]
- Custom Taxonomy type in nav menu
- Advanced search: roles and multiple taxonomies
- One taxonomy template for all categories?
- Removing fields from category/taxonomy edit form
- Error in Custom Taxonomy UI
- Remove ‘portfolio’ from URL
- Two taxonomies with the same slug
- Hook function when taxonomy terms change