Support

Account

Home Forums General Issues Condition for acf and the_post() content Reply To: Condition for acf and the_post() content

  • Hi you could do something like this:

    <?php if( get_field('field_one') || get_field('field_two') ) { ?>
    <?php the_field('field_one'); ?> <?php the_field('field_two'); // Display the fields not the content ?>
    <?php } else { ?>
    <?php the_content(); ?>
    <?php } ?>

    So we check to see if any fields exist and if they do we display them, if not we display the post’s content.

    I hope that helps!