How to loop only categories without posts (+ show category featured image with acf) [closed]

Well, in WP the word “loop” is mainly related to posts. It’s easier to say that you want to display categories.

All you have to do is to get them using get_categories function and display them.

<?php
    $categories = get_categories( array(
        'orderby' => 'name',
        'order'   => 'ASC'
    ) );
    if ( ! empty( $categories ) ) :
?>
<ul>
    <?php foreach ( $categories as $category ) : ?>
    <li><a href="https://wordpress.stackexchange.com/questions/325569/<?php echo esc_attr(get_category_link( $category->term_id ) ); ?>"><?php echo esc_html( $category->name ); ?></a></li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>

And if you want to change the category title to some ACF custom field, then change this part:

<?php echo esc_html( $category->name ); ?>

to:

<?php echo wp_get_attachment_image( get_field('<FIELD_NAME>', $category), 'full' ); ?>

PS. Remember to change to real name of the field. It should return the ID of an image (and not the array – you should set it in field setting). You can also change the ‘full’ size to some other size.