Home Forums Front-end Issues Repeater field toggle showing incorrect content


Repeater field toggle showing incorrect content

  • Hey everyone… I have a bit of a strange issue, which would possibly be simple but im just missing it! So any help at all will be so appreciated!

    Below is the code I am using, along with a toggle function that I have also included below.

    <div class="team-members">
    <?php if( have_rows('team') ): ?>
    	<?php while( have_rows('team') ): the_row(); 
    		// vars
    		$image = get_sub_field('image');
    		$name = get_sub_field('name');
    		$position = get_sub_field('position');
    		$description = get_sub_field('extended_description');
    		<li class="team-member-select team-toggle">
    		<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>" />
    	<?php echo $name; ?>
    				<?php echo $position; ?>
    <div class="team-member-open">
    		<p class="team-close">
    	<div class="team-left">
    		<img src="<?php echo $image['url']; ?>">
    	<div class="team-right">
    			<?php echo $name; ?>
    				<?php echo $position; ?>
    		<?php echo $description; ?>
    	<?php endwhile; ?>
    <?php endif; ?>

    Toggle function:

        $(".team-member-open").hide( "ease" );
        $(".team-member-open").show( "ease" );

    Everything works beautifully! Each item shows up as it should.

    Below is an image of the boxes, with the image, name and title. All working as it should.

    3 team boxes

    When any of these boxes is clicked, the div below appears:

    Boxes clicked

    The only issue is the content is always the same no matter which box is clicked.

    I was hoping for it to show the information relative to the box clicked however I must be missing something.

    Anybody have any ideas on how I could fix this?

Viewing 1 post (of 1 total)

The topic ‘Repeater field toggle showing incorrect content’ is closed to new replies.