I am new to WP and ACF and I am trying to get each category to display a featured image using a custom field set up with ACF.
I have added a field group with the location rule to show the field group if taxonomy term is equal to categories. I have then added the <?php the_field( 'add_featured_image' ); ?>
to single.php
The custom field is displaying in the category options, allowing me to select a featured-image, but it is not displaying when published.
I have also tried the various different ways of targeting the ID of a single category instead of all the categories as per the ACF docs such as
<?php the_field( 'add_featured_image', 'category_6' ); ?>
or
<?php the_field('add_featured_image', 6); ?>
but nothing is working.
The nearest I have got is when using
<?php the_field( 'add_featured_image', 'category_6' ); ?>
which outputs this on the screen:
I have also tried the get_field()
function to no avail. I am using FoundationPress as a parent theme.
Any help would be greatly appreciated.