i dont know php so is hard 🙂
replace
// do something special for gallery fields
with
<?php
$image_ids = get_field('gallery', false, false);
$shortcode = '[' . 'gallery ids="' . implode(',', $image_ids) . '"]';
echo do_shortcode( $shortcode );
?>
or
$image_ids = get_field('gallery', false, false);
$shortcode = '[' . 'gallery ids="' . implode(',', $image_ids) . '"]';
echo do_shortcode( $shortcode );
in this code do I have to replace something?
if in the place of a generic code i uses individual codes of the kind
<p><strong> Location of copies: </p></strong> <?php the_field( 'location_of_copies', $post->ID ); ?>
which is the gallery code that work with a field of gellery name album?
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
?>
surely 2. I did not check but …
I’m sorry to have bothered you with such a trifle
but the problem here is very important
https://support.advancedcustomfields.com/forums/topic/gallery-array/
is something simple I think, but I dont find solution
but I do not want to quit because I want the label to be capitalized, but the text of the field to be normal
because of echo ‘<h3>’ . $field[‘label’] . ‘</h3>’;
from the code
for every label? I have 50-60 field
and are we talking about label or field content? that I am interested in the contents of the field
thank you
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.