Support

Account

Forum Replies Created

  • Never mind I found the solution. This is the code I used

    <?php $category_id = get_queried_object_id(); ?>
     <?php $cat_id = 'category_'.$category_id; ?>
     <?php $image = get_field( 'cover', $cat_id); ?>
     <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
  • I want a featured image for every category and not specific id category.I want to target the current category every time. I’m sorry if I get something wrong

Viewing 2 posts - 1 through 2 (of 2 total)