Support

Account

Home Forums Add-ons Repeater Field Repeater field not working with multiple conditional statements

Solved

Repeater field not working with multiple conditional statements

  • I can’t seem to figure this out…I had a repeater field that worked perfectly, when I added a new hyperlink field so that each div would be clickable to another page, the entire repeater field is now displaying oddly. If I remove the social icons section though, it works as expected – only problem being that I need that social icons section – any ideas to why the repeater field is breaking with this new hyperlink sub field?

    My code is as follows:

    <section class="container-fluid-full"">
        <?php if( have_rows('speakers') ): ?>
      <div class="row">
        <?php while( have_rows('speakers') ): the_row(); ?>
        <a href="<?php the_sub_field('abstract_link'); ?>">
        <div class="col-lg-3 speaker" style="background: linear-gradient(rgba(38, 90, 164, 0.2),rgba(63, 56, 196, 0.7)), url('<?php the_sub_field('speaker_photo'); ?>') no-repeat top; background-size: cover;">
    <span class="social-handles">
      <?php if( get_sub_field('twitter_handle') ): ?>
          <span>
          <a href="https://twitter.com/<?php the_sub_field('twitter_handle'); ?>" target="_blank">
          <img src="/img/logo-twitter.svg" width="22" alt="Twitter">
          </a>
        <?php endif; ?>
        </span>
    </span>
     
    <span class="social-handles">
    <?php if( get_sub_field('linkedin_handle') ): ?>
        <span>
          <a href="https://www.linkedin.com/in/<?php the_sub_field('linkedin_handle'); ?>" target="_blank">
          <img src="/img/linkedin-logo.svg" width="22" alt="Linked-in" style="position:relative; top:-2px;">
          </a>
        <?php endif; ?>
        </span>
    </span>
     
        <p class="text--white"><?php the_sub_field('speaker_name'); ?><br>
        <span class="text--white"><?php the_sub_field('position'); ?>,  <span class="bolder"><?php the_sub_field('company'); ?></span></span></p>
        </div>
        <?php endwhile; ?>
        <?php endif; ?>
      </div>
      </a>
    </section>
  • solved. stuck tag inside javascript onclick tag for each div

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

The topic ‘Repeater field not working with multiple conditional statements’ is closed to new replies.