I have some custom code in order to display my custom fields the way I want.
Unfortunately, with this code I can't seem to access the $field['label']
. I tried various ways but don't really know how to achieve this.
<?php
$fields = get_fields();
if( $fields ): ?>
<ul>
<?php
foreach( $fields as $name => $value ):
if (stripos($name, 'isbn') !== false) : ?>
<li><b><?php echo $name['label']; ?></b> <?php echo $value; ?></li>
<?php endif;
endforeach; ?>
</ul>
<?php endif; ?>
$value['label']
and not$name['label']
?var_dump($fields);
after$fields = get_fields();
and check its output. Is there thelabel
item?get_field_objects()
and notget_fields()
. =)