Support

Account

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

  • I figured it out. Here is my code…

    <section>
        <?php
    $args = array(
      'orderby' => 'name',
      'order' => 'ASC'
      );
    $categories = get_categories('child_of=39', $args);
      foreach($categories as $category) { ?>
        <div class="casino-games">
          <?php $image_url=get_field('featured_category_image', $category); ?>
          <a href="<?php get_category_link( $category->term_id ) ?>" title="<?php sprintf( __( "View all posts in %s" ), $category->name ) ?>" />
          <h3><?php echo $category->name ?></h3>
          <img src="<?php echo $image_url ?>" /> </a> </div>
        <?php } ?>
        <div class="clear"></div>
      </section>

    it was this part that did the trick for me…
    <?php $image_url=get_field('featured_category_image', $category); ?>