In Advanced Custom Fields (ACF) I created an image field and added that to the categories of a custom post type so every category can have his own image. Then I created a loop that displays the categories of that custom post type. This works but I can't get the image that I uploaded in the ACF field to display.
The code for displaying the categories of the custom post type:
<?php $taxonomy = 'customposttype'; $terms = get_terms($taxonomy); if ( $terms && !is_wp_error( $terms ) ) : ?>
<?php foreach ( $terms as $term ) { ?>
<?php echo $term->name; ?>
// display acf image
<?php } ?>
<?php endif;?>
I tried to work with 'array_combine' but I couldn't get that to work.