Home › Forums › Add-ons › Repeater Field › Ordering images in a lightbox
Hello, begenning with repeater field. I have an issue and don’t undersand why the field are not in the correct order. all the lightbox appears with the last images. Moving the order of the image in the backoffice don’t change a thing
My code :
<div id="presse">
<?php query_posts('showposts=-1&post_type=revuedepresse&order=ASC'); ?>
<?php while (have_posts()) : the_post(); ?>
<ul>
<li>
<?php while(the_repeater_field('extrait')): ?>
<a class="fancybox" href="<?php the_sub_field('image'); ?>" rel="<?php the_sub_field('lightbox'); ?>" >
<?php endwhile;?>
<img src="<?php the_field('parution'); ?>" alt="" /></a>
</li>
</ul>
<?php endwhile;?>
<?php wp_reset_query(); ?>
</div> <!-- fin de contenu presse -->

I look in the code source page and the order seems right :
<ul>
<li>
<a class="fancybox" href="http://localhost:8888/moyat/wp-content/uploads/2013/07/MM01.jpg" rel="marianne" >
<a class="fancybox" href="http://localhost:8888/moyat/wp-content/uploads/2013/07/MM02.jpg" rel="marianne" >
<img src="http://localhost:8888/moyat/wp-content/uploads/2013/07/marianne_maion.png" alt="" /></a>
</li>
</ul>

Hi @rickky
If the order is correct in your source code, then we can both agree that ACF is doing it’s job correctly.
The problem must lie with the JS that is creating the popupbox. Perhaps there is some sort of rand setting?
I would jump on google and find any forum talking about this issue as it is not specific to ACF.
Thanks
E
The topic ‘Ordering images in a lightbox’ 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.