Created
March 30, 2019 06:19
-
-
Save loorlab/9813352090ae0c4587cbf35079da5a5f to your computer and use it in GitHub Desktop.
Even / Odd Display with Repeater ACF Field - WordPress
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 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