Server : Apache System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : andertr9 ( 1047) PHP Version : 8.2.18 Disable Function : NONE Directory : /home1/andertr9/www/wp-content/themes/anderson/template-parts/ |
Upload File : |
<?php /** * The template used for displaying content equipments * * Prohibit direct script loading ------------------------------------------------------------ */ defined( 'ABSPATH' ) || die( ); if ( function_exists( 'get_field' ) && function_exists( 'have_rows' ) && have_rows( 'pool-equipments' )) : $equipments = get_field( 'pool-equipments' ); ?> <div class="pool-equipments"> <div class="mobile-desktop"> <div class="row"> <?php $rows = floor( count( $equipments ) / 3 ); ?> <?php for( $jndex = 0 ; $jndex < 3 ; $jndex++ ) : ?> <div class="column four"> <?php for( $kndex = 0 ; $kndex < $rows ; $kndex++ ) : ?> <?php $index = $kndex * 3 + $jndex; ?> <?php $equipment = (object)$equipments[ $index ]; ?> <div class="equipment"> <?php if ( $equipment->{ 'equipment-image' }) : ?> <div class="image"> <img src="<?php echo $equipment->{ 'equipment-image' }; ?>" alt="<?php echo $equipment->{ 'equipment-title' }; ?>" /> </div> <?php endif; ?> <h3 class="title"><?php echo $equipment->{ 'equipment-title' }; ?></h3> <div class="description"><?php echo do_shortcode( wpautop( $equipment->{ 'equipment-description' })); ?></div> </div> <?php endfor; ?> <?php if (( $jndex == 0 && count( $equipments ) % 3 ) || ( $jndex == 1 && count( $equipments ) % 3 == 2 )) : ?> <?php $index = $kndex * 3 + $jndex; ?> <?php $equipment = (object)$equipments[ $index ]; ?> <div class="equipment"> <?php if ( $equipment->{ 'equipment-image' }) : ?> <div class="image"> <img src="<?php echo $equipment->{ 'equipment-image' }; ?>" alt="<?php echo $equipment->{ 'equipment-title' }; ?>" /> </div> <?php endif; ?> <h3 class="title"><?php echo $equipment->{ 'equipment-title' }; ?></h3> <div class="description"><?php echo wpautop( do_shortcode( $equipment->{ 'equipment-description' })); ?></div> </div> <?php endif; ?> </div> <?php endfor; ?> </div> </div> <div class="tablet"> <div class="row"> <?php $rows = floor( count( $equipments ) / 2 ); ?> <?php for( $jndex = 0 ; $jndex < 2 ; $jndex++ ) : ?> <div class="column six"> <?php for( $kndex = 0 ; $kndex < $rows ; $kndex++ ) : ?> <?php $index = $kndex * 2 + $jndex; ?> <?php $equipment = (object)$equipments[ $index ]; ?> <div class="equipment"> <?php if ( $equipment->{ 'equipment-image' }) : ?> <div class="image"> <img src="<?php echo $equipment->{ 'equipment-image' }; ?>" alt="<?php echo $equipment->{ 'equipment-title' }; ?>" /> </div> <?php endif; ?> <h3 class="title"><?php echo $equipment->{ 'equipment-title' }; ?></h3> <div class="description"><?php echo wpautop( do_shortcode( $equipment->{ 'equipment-description' })); ?></div> </div> <?php endfor; ?> <?php if (( $jndex == 0 && count( $equipments ) % 2 )) : ?> <?php $index = $kndex * 2 + $jndex; ?> <?php $equipment = (object)$equipments[ $index ]; ?> <div class="equipment"> <?php if ( $equipment->{ 'equipment-image' }) : ?> <div class="image"> <img src="<?php echo $equipment->{ 'equipment-image' }; ?>" alt="<?php echo $equipment->{ 'equipment-title' }; ?>" /> </div> <?php endif; ?> <h3 class="title"><?php echo $equipment->{ 'equipment-title' }; ?></h3> <div class="description"><?php echo wpautop( do_shortcode( $equipment->{ 'equipment-description' })); ?></div> </div> <?php endif; ?> </div> <?php endfor; ?> </div> </div> </div> <?php endif;