Hi!
I bought pro version today and i need some help with Gallery.
I use the next code for show it but don’t show any image of post.
<?php
$images = get_field('gallery');
if( $images ): ?>
<ul>
<?php foreach( $images as $image ): ?>
<li>
<a href="<?php echo $image['url']; ?>">
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
</a>
<?php echo $image['caption']; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
I need some help please. Thanks
Nothing in your code appears obviously incorrect. Is your gallery field named correctly? Do you have the field populated in the backend?
This reply has been marked as private.
This reply has been marked as private.
How can populate that? Others custom post types work. Only Gallery is bad.
This reply has been marked as private.
This reply has been marked as private.
I must change gallery with images. nothing more. thanks
Hi @contacto9
Can you confirm the custom field you have created has a name of gallery
? This is most likely the issue.
Please debug your data: http://www.advancedcustomfields.com/resources/how-to/debug/
I also got this problem, i only get an array of attachment id´s back, so the default script you give in your example doesn´t work the values arent in the array so it seems
Hi @Gijs
If you are only getting attachment ID’s, can you please attach the code you are using to get the data?