You can use a multidimensional array to get this format. Please see the example given below:
$terms = get_terms(
array(
'taxonomy' => "issueCompanion",
'hide_empty' => false,
'fields'=>'all'
)
)
$multi_arr = array();
foreach($terms as $term){
$year = get_field('published_year', $term->term_id);
$multi_arr[$year][] = $term->name;
}
When you print this $multi_arr you will get the format you want. So you can manage your code according to this.
Related Posts:
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Control content before and after custom post type loop
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Show parent category and subcategory once in while loop
- Add active class to foundation 6 tabs while looping categories
- WordPress query posts by custom post type not workng
- WordPress Custom Post Type and sort by Tags
- Order by custom field attribute
- Looping taxonomy in taxonomy?
- Get Custom Taxonomy ID within loop
- Get custom post type by category in a page template
- Categories under custom post types doesn’t show properly
- Order custom posts by taxonomy?
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Taxonomy posts on Archive page
- How to display the rest of categories on Portfolio filterable
- How to get only one category of custom post type?
- Get all taxonomies for all post types
- Append taxonomy terms as class names in markup?
- How to append element after thumbnail
- ‘category__and’ for custom taxonomy?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Display custom field of specific post where post title matches variable
- How to output wordpress custom tags separated by comma?
- Normal pages as children of my Custom Post Type
- Only show posts from a certain category?
- Custom Post Type Loop throws 500 error when used in widget
- get_attached_media() on author page not working
- Received nothing after executing AJAX post function
- Custom loop with multiple taxonomy queries
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Custom post type multiple loop by taxonomy term
- List custom taxonomy specific to one custom post type
- Custom Tag Description unable to display just below and outside of the Loop
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Group CPT posts by custom taxonomy
- What’s the WP way to load remaining custom posts?
- Categorize custom post type
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Display Custom Taxonomy Alphabetically
- Display related custom taxonomy posts in sidebar
- get_the_title() is returning results from previous loop
- Get term name without a foreach loop
- Including all post id’s of a custom post type into an array
- How can I group posts by months and years?
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Main query not querying any posts in custom taxonomy template
- Using wp_query to modify the loop in index.php for a CPT
- Get custom post type categories to show up in menus
- looping though custom post types and only return results in a given taxonomy
- Show current custom taxonomy
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- get_terms() parent, child and grandchild
- List all Custom Post Type posts excluding certain Taxnomy term
- Foreach loop returning more than one item when querying taxonomy
- Create a custom taxonomy template that loops through child categories in term order?
- Loop and add Specific Categories and Products Images
- Displaying Posts Using a Custom Query with a Custom Field and a term_id
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- How can I increase the post count for custom post types only?
- Custom post type page with parameter
- How can I loop at a Specific Taxonomy from a custom post type?
- Page that lists publications by classifying them by taxonomy
- Custom archive page for custom taxonomy and pagination issue
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Check that a slug is present in the get_terms request
- Custom post type paging return home page
- Assigning categories to custom post types via a front-end form; only works for native post type
- when looping through custom post data not appearing
- pagination problem listing custom post types of taxonomy in wordpress
- Custom Post Type has wrong label and is not found when called by a loop
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- List all posts associated under custom taxonomy
- Custom Taxonomy – fields
- Loop to display parent categories in custom taxonomy
- Custom taxonomy template for custom fields loop [closed]
- How to show terms used only for particular custom post type. Filter creation perpose
- Display related post content and custom field content
- The most recent post of custom taxonomy
- Show tags of custom post types in WordPress
- Show posts for current taxonomy
- Custom post types not displaying per category
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Custom post type with custom taxonomy permalinks
- Loop multiple taxonomy in custom post
- Post data in separate divs with incrementing class using WP_Query
- Values inside a custom field to determine which category posts to display
- Show Custom Post Type taxonomy term that matches custom field
- Posts without featured image using other post’s featured image
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- Loop through multiple custom taxonomy terms and display posts for a custom post type
- Inserting two categories
- display custom post type from register taxonomy
- Get all active posts that are tied to a custom taxonomy for a custom post type
- I want to show image from custom field image on my custom page template