Advertisement
lpjjonline

Untitled

Feb 1st, 2023 (edited)
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <ul>
  2. <?php
  3. // check if the repeater field has rows of data
  4. if( have_rows('flavors') ):
  5. // loop through the rows of data
  6. while ( have_rows('flavors') ) : the_row();
  7. // display a sub field value
  8. ?>
  9.  
  10. <li>
  11.  
  12.  
  13. <a href="#<?php if( get_sub_field('beer_title') ): ?>" class="wplightbox" data-width=900 data-height=800 >
  14. <?php the_sub_field('beer_title'); ?>
  15. <?php endif; ?>
  16.  
  17.  
  18.  
  19. <?php
  20. $image = get_sub_field('beer_image');
  21. if( !empty( $image ) ): ?>
  22. <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
  23. <?php endif; ?>
  24.  
  25. <?php if( get_sub_field('beer_title') ): ?>
  26. <?php the_sub_field('beer_title'); ?>
  27. <?php endif; ?>
  28.  
  29. </a>
  30.  
  31.  
  32.  
  33. <div id="<?php echo get_sub_field('flavor_name') ?>" style="display: none;">
  34.  
  35. <div class="flavors">
  36.  
  37. <div class="flavorsleft">
  38. <?php
  39. $image = get_sub_field('beer_image');
  40. if( !empty( $image ) ): ?>
  41. <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
  42. <?php endif; ?>
  43. </div>
  44.  
  45. <div class="flavorsright">
  46. <h3><?php if( get_sub_field('beer_title') ): ?>
  47. <?php the_sub_field('beer_title'); ?>
  48. <?php endif; ?></h3>
  49.  
  50. <div class="percent">
  51. <?php if( get_sub_field('alcohol_percentage') ): ?>
  52. <?php the_sub_field('alcohol_percentage'); ?>
  53. <?php endif; ?>
  54. </div>
  55.  
  56. <?php if( get_sub_field('beer_description') ): ?>
  57. <?php the_sub_field('beer_description'); ?>
  58. <?php endif; ?>
  59.  
  60. </div>
  61. </div>
  62. </div>
  63.  
  64. <div class="clear"></div>
  65.  
  66. </li>
  67.  
  68. <?php
  69. endwhile;
  70. else :
  71. // no rows found
  72. endif;
  73. ?>
  74. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement