Last active
August 8, 2023 14:51
-
-
Save jackfearing/0d53e020b73cf0632ac73c8c975c87cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr($classes); ?>"> | |
<?php | |
$repeater_field = get_field('tiles'); | |
if ($repeater_field) { | |
$index = 1; | |
?> | |
<div class="tile__container"> | |
<?php | |
while (have_rows('tiles')) : the_row(); | |
$class_name = 'class-name-' . $index; | |
?> | |
<div id="tile-<?php echo get_row_index(); ?>" class="tile__items <?php echo $class_name; ?>"> | |
<h3><?php the_sub_field('tiles_title'); ?></h3> | |
<?php the_sub_field('tiles_content'); ?> | |
</div> | |
<?php | |
$index++; | |
endwhile; | |
?> | |
</div> <!-- tile__container --> | |
<?php | |
} | |
?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr($classes); ?>"> | |
<?php | |
$repeater_field = get_field('tiles'); | |
if ($repeater_field) { | |
$index = 1; | |
?> | |
<div class="grid-container"> | |
<?php | |
while (have_rows('tiles')) : the_row(); | |
$class_name = 'class-name-' . $index; | |
?> | |
<div class="grid-item"> | |
<h3><?php the_sub_field('tiles_title'); ?></h3> | |
<?php the_sub_field('tiles_content'); ?> | |
</div> | |
<?php | |
$index++; | |
endwhile; | |
?> | |
</div> <!-- tile__container --> | |
<?php | |
} | |
?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> | |
<?php $repeater_field = get_field('tiles'); ?> | |
<?php if ( have_rows( 'tiles' ) ) : ?> | |
<div class="tile__container "> | |
<?php while ( have_rows( 'tiles' ) ) : the_row(); ?> | |
<div id="tile-<?php echo get_row_index(); ?>" class="tile__items"> | |
<h3><?php the_sub_field( 'tiles_title' ); ?></h3> | |
<?php the_sub_field( 'tiles_content' ); ?> | |
</div> | |
<?php endwhile; ?> | |
</div> <!-- tile__container --> | |
<?php else : ?> | |
<?php // No rows found ?> | |
<?php endif; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment