Last active
August 29, 2015 14:01
-
-
Save barbwiredmedia/87c20a2c2458bc8de70b to your computer and use it in GitHub Desktop.
ACF Advanced custom fields output field only if exists. Check if field exists and has content.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (get_field('your_field')): ?> | |
<?php the_field('your_field'); ?> | |
<?php endif; ?> | |
<!-- Else example --> | |
<?php if (get_field('your_field')) : ?> | |
<?php the_field('your_field'); ?> | |
<?php else : ?> | |
<!--alternate stuff--> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment