Home Forums General Issues Display ALL acf fields in ALL published posts?


Display ALL acf fields in ALL published posts?

  • I have created an ACF field group that applies to a particular post category. The fields show up fine in the post editor. Is there an easy way to have all ACF fields data displayed in all published posts with the given category?

  • Assuming you want these fields to display on the actual single post pages of a given category the following should work.

    <?php if ( in_category('cat-slug or ID') ) { ?>
      // do stuff with the ACF fields
    <?php } ?>

    This would go in single.php

    More info…

  • Thanks, Ben. Didn’t quite work the way I wanted. Here’s what I found worked in the Twenty-Fourteen theme (content.php) directly under <div class=”entry-content”>:

    <b>chosen label: </b><?php the_field(‘field_name’); ?><br>

    When it came to displaying Advance Custom Fields in a Genesis child theme, I had trouble also, but found my answer here:

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

The topic ‘Display ALL acf fields in ALL published posts?’ is closed to new replies.