Forked from loorlab/even_odd_display_repeater_acf_WP.php
Created
December 17, 2020 20:04
-
-
Save jenhuls/d9997eaa73706f4a28729274135ec359 to your computer and use it in GitHub Desktop.
Even / Odd Display with Repeater ACF Field - WordPress
This file contains hidden or 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 class="level customers level-wrapper"> | |
<ul class="categories"> | |
<?php if( have_rows('items_page_block') ): ?> | |
<?php while( have_rows('items_page_block') ): the_row(); | |
// vars | |
$image_item_block = get_sub_field('image_item'); | |
$title_item_block = get_sub_field('title_item'); | |
$text_item_block = get_sub_field('text_item'); | |
if( get_row_index() % 2 == 0 ){ ?> | |
<li class="customers-item"> | |
<figure><img src="<?php echo $image_item_block['url']; ?>" alt="<?php echo $image_item_block['alt'] ?>" /></figure> | |
<div class="left"> | |
<p class="title-article-2 title-article-2--blue-light"><?php echo $title_item_block; ?></p> | |
<p class="paragraph-1 paragraph-1--black"><?php echo $text_item_block; ?></p> | |
</div> | |
</li> | |
<?php } else { ?> | |
<li class="customers-item"> | |
<figure><img src="<?php echo $image_item_block['url']; ?>" alt="<?php echo $image_item_block['alt'] ?>" /></figure> | |
<div class="right"> | |
<p class="title-article-2 title-article-2--blue-light"><?php echo $title_item_block; ?></p> | |
<p class="paragraph-1 paragraph-1--black"><?php echo $text_item_block; ?></p> | |
</div> | |
</li> | |
<?php } ?> | |
<?php endwhile; ?> | |
<?php endif; ?> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment