Home › Forums › Front-end Issues › Show an entire specific field group in frontend › Reply To: Show an entire specific field group in frontend
Hi Elliot,
Thanks for this code, its working good for input fields but how can I get values from checkboxes, now it just displays – Array
I modified the code a bit, to check if value is an array, but it is giving me a Field Name (ugly) not the Field Label
<?php
$group_ID = 327;
$fields = array();
$fields = apply_filters('acf/field_group/get_fields', $fields, $group_ID);
if( $fields )
{
foreach( $fields as $field )
{
$value = get_field( $field['name'], 'user_' . $author->ID );
echo '<dl>';
echo '</br><dt>' . $field['label'] . '</dt>';
if(is_array($value)) {
foreach($value as $singleValue){
echo '<dd>' .$singleValue . '</dd> ';
}
} else {
echo '<dd>' .$value . '</dd> ';
}
echo '</dl>';
}
}
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.