Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul>
- <?php
- // check if the repeater field has rows of data
- if( have_rows('flavors') ):
- // loop through the rows of data
- while ( have_rows('flavors') ) : the_row();
- // display a sub field value
- ?>
- <li>
- <a href="#<?php if( get_sub_field('beer_title') ): ?>" class="wplightbox" data-width=900 data-height=800 >
- <?php the_sub_field('beer_title'); ?>
- <?php endif; ?>
- <?php
- $image = get_sub_field('beer_image');
- if( !empty( $image ) ): ?>
- <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
- <?php endif; ?>
- <?php if( get_sub_field('beer_title') ): ?>
- <?php the_sub_field('beer_title'); ?>
- <?php endif; ?>
- </a>
- <div id="<?php echo get_sub_field('flavor_name') ?>" style="display: none;">
- <div class="flavors">
- <div class="flavorsleft">
- <?php
- $image = get_sub_field('beer_image');
- if( !empty( $image ) ): ?>
- <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
- <?php endif; ?>
- </div>
- <div class="flavorsright">
- <h3><?php if( get_sub_field('beer_title') ): ?>
- <?php the_sub_field('beer_title'); ?>
- <?php endif; ?></h3>
- <div class="percent">
- <?php if( get_sub_field('alcohol_percentage') ): ?>
- <?php the_sub_field('alcohol_percentage'); ?>
- <?php endif; ?>
- </div>
- <?php if( get_sub_field('beer_description') ): ?>
- <?php the_sub_field('beer_description'); ?>
- <?php endif; ?>
- </div>
- </div>
- </div>
- <div class="clear"></div>
- </li>
- <?php
- endwhile;
- else :
- // no rows found
- endif;
- ?>
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement