Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // Repeater Field
- if( have_rows('top_5', 'options') ): ?>
- <ul>
- <?php while( have_rows('top_5', 'options') ): the_row();
- // vars (repeater)
- $country_id = get_sub_field('country');
- $country_name = get_the_title( $country_id );
- $permalink = get_the_permalink( $country_id );
- $n = 1;
- // check for rows (sub repeater)
- if( have_rows('the_index', $country_id) ):
- $i = 0;
- // loop through rows (sub repeater)
- while( have_rows('the_index', $country_id) ): the_row();
- // vars (sub-repeater)
- $pi_id = get_sub_field('philanthropist');
- $pi_id_1 = $pi_id[0];
- $pi_name = get_the_title( $pi_id );
- $pi_image = get_field('image', $pi_id);
- $pi_image_url = !empty( $pi_image ) ? $pi_image['sizes']['thumbnail'] : get_template_directory_uri() . '/images/article-default-4x3.png';
- // stop after x number of loops
- if (++$i == 1) break;
- endwhile;
- endif; // if( get_sub_field('sub-repeater') ): ?>
- <a href="<?php echo $permalink; ?>" class="aside-link animate-all group">
- <img src="<?php echo $pi_image_url; ?>" class="responsive aside-thumb animate-all" alt="<?php echo $pi_name; ?>">
- <h4 class="animate-all"><?php echo $country_name; ?></h4>
- <p><?php //No 1: ?><?php echo $pi_name; ?></p>
- </a>
- <?php endwhile; ?>
- </ul>
- <?php endif; // End Repeating items ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement