<?php $fields = acf_get_fields('6066');
?>
<?php if( $fields )
{
foreach( $fields as $subject)
{
$worth = get_field( $subject['name'] );
if ($worth) {
echo '<dl>';
echo '<dt>' . $subject['label'] . '</dt>';
echo '<dd>' . $subject['value'] . '</dd>';
echo '</dl>';
}
}
}
?>
That is what I’ve. If I do a var_dump
on acf_get_fields
, it apparently units the worth to NULL
. I may have recognized, because it’s written right here:
https://www.advancedcustomfields.com/assets/get_field_object/
The issue: I’ve to first get all fields in a particular field_group, therefore I’m utilizing acf_get_fields
.
I believed with utilizing $subject['value']
I may get it to work, however apparently this doesn’t work.
Can somebody assist me to retrieve the values within the foreach per subject? Certainly there should be a method, proper?
PS:
<?php
$fields = get_fields();
if( $fields ): ?>
<ul>
<?php foreach( $fields as $identify => $worth ): ?>
<li><b><?php echo $identify; ?></b> <?php echo $worth; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
This offers me ALL fields. I simply want a particular record of fields from a particular subject group. That’s the downside.
I attempted all ideas right here: ACF – get fields from group, however none of them do the trick for my case.