add_action('init', function(){
function get_funds(){
+ $all_funds = [];
$custom_terms = get_terms('fund_group');
foreach($custom_terms as $custom_term) {
wp_reset_query();
- $args = array('post_type' => 'fund',
+ $args = array(
+ 'post_type' => 'fund',
+ 'numberposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'fund_group',
'field' => 'slug',
'terms' => $custom_term->slug,
- ),
+ 'hide_empty' => false
+ ),
),
);
$loop = get_posts($args);
foreach($loop as $l){
$funds_grouped[$custom_term->name][] = $l->post_title;
- $all_funds[] = $l->post_title;
+ $all_funds[]= $l->post_title;
}
}