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?
How can populate that? Others custom post types work. Only Gallery is bad.
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?
The topic ‘Gallery don't work’ is closed to new replies.
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.