Created
February 5, 2016 18:44
-
-
Save FriendlyWP/20f93bf66ba88cb516f8 to your computer and use it in GitHub Desktop.
Display all ACF field names / field values for any given post.
This file contains hidden or 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
if (function_exists('get_field')) { | |
$fields = get_fields(); | |
if( $fields ) { | |
foreach( $fields as $field_name => $value ) { | |
$field = get_field_object($field_name, false, array('load_value' => false)); | |
if($value) { | |
echo '<div>'; | |
echo '<h3>' . $field['label'] . '</h3>'; | |
echo $value; | |
echo '</div>'; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment