Home › Forums › Front-end Issues › gallery Array › Reply To: gallery Array
I do not really understand
besides replacing it THE_NAME_OF_YOUR_GALLERY_FIELD with the name of the gallery field, album, something else to be done?
I do not understand why it is so complicated
it does not display any existing or uploaded photos
<?php
$fields = get_fields($post->ID);
if ($fields) {
?>
<ul>
<?php
foreach ($fields as $name => $value) {
?>
<li>
<b><?php echo $name; ?></b>
<?php
if ($name == 'album') {
// do something special for gallery fields
} else {
// basic field
echo $value;
}
?>
</li>
<?php
} // end foreach fields
?>
</ul>
<?php
} // end if fields
?>
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.