Home › Forums › Add-ons › Gallery Field › ACF Gallery vs WPML › Reply To: ACF Gallery vs WPML
Realise this is an old post but I’ve tried using the following code:
<?php
global $sitepress;
$current_main_id = icl_object_id( get_the_id(), 'post', true, $sitepress->get_default_language() );
$awards_images = get_field('our_wines_awards', $current_main_id);
if( $awards_images ): ?>
<ul class="press awards cf">
<?php foreach( $awards_images as $awards_image ): ?>
<li>
<img src="<?php echo $awards_image['sizes']['large']; ?>" alt="<?php echo $awards_image['alt']; ?>" />
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
But it still seemingly displays the images in a completely random order.
Am I doing something wrong in my code?
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.