Support

Account

Home Forums Add-ons Repeater Field Repeater field and ajax lightbox

Unread

Repeater field and ajax lightbox

  • Hi,

    I’ld like to use the repeater field to generate a lightbox but I can’t figure out the best way to find out which link is clicked. Is there a way get the ACF row ?

    I want to call the lightbox content with ajax (as I have a picture, title, subtitle and text on it), so I’ld like to pass the row number to ajax.

    If there’s a way to do that, how would I go about getting all informations just for that row then ?

    I just don’t really see a simple way to go about this right now, so any help would be greatly appreciated. I’ll include the code I have so far for the front-end.

    <?php if(get_field('team_member')): ?>
        <?php while(has_sub_field('team_member')): ?>
           <?php
                $id_photo = get_sub_field('photo');
                $size = 'team_small';
                echo row_number();
    ?>
             <div class="team_member">
                 <a href="#" data-post="<?php the_ID(); ?> data-row="..."><?php echo wp_get_attachment_image($id_photo, $size); ?></a>
                     <div class="informations">
                       <h3><?php the_sub_field('name'); ?></h3>
                       <p><?php the_sub_field('statut'); ?></p>
                      </div>
              </div>
      <?php endwhile; ?>
    <?php endif; ?>

    Thanks for your help

Viewing 1 post (of 1 total)

The topic ‘Repeater field and ajax lightbox’ is closed to new replies.