Support

Account

Home Forums General Issues Category Images not displaying Reply To: Category Images not displaying

  • I know this thread is aging, but any help would be greatly appreciated.

    I have a similar problem, which I cannot seem to locate a solution for in the documentation or forum, but this looks as close as I can get so far.

    I have a default category.php template and have added the following code to it to display my category icon, which works on the index.php page of my site just perfectly.

    <?php
         $args = array(
         'orderby' => 'name',
         'order' => 'ASC'
         );
    $categories = get_categories($args);
    foreach($categories as $category) { ?>
    <?php echo $image_url=the_field('event_type_category_icon', $category); ?>
    <img src="<?php echo $image_url=the_field('event_type_category_icon', $category); ?>" />
    <?php } 
    ?>

    But when I want to display the specific category icon on its coordinating category page, it displays an image ID instead of the image URL (which would reflect the image itself) and shows that the image is coming from the actual /category/ directory as well which is not true.

    Please help!

    Michael