Combine multiple separate lists into one

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. … Read more