Support

Account

Home Forums Add-ons Repeater Field Ordering images in a lightbox

Solving

Ordering images in a lightbox

    • rickky

    • September 25, 2013 at 1:49 am

    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 -->
    • Elliot

    • September 25, 2013 at 12:49 pm

    Hi @rickky

    Looking at the source code generated, are the img elements in the correct order?

    • rickky

    • September 25, 2013 at 9:48 pm

    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>
    
    • rickky

    • September 27, 2013 at 4:30 am

    No idea ?

    • Elliot

    • September 30, 2013 at 2:41 pm

    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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

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.