Created
May 28, 2020 06:53
-
-
Save onuproy/2c708c1d333305b9a12ceb754e49999a to your computer and use it in GitHub Desktop.
ACF Custom post Type Left Right Right left 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
<?php if(have_rows('onup_row')) : ?> | |
<?php $i = 0; while(have_rows('onup_row')) : the_row(); $i++; | |
$title = get_sub_field( 'title' ); | |
$img = get_sub_field( 'image' ); | |
?> | |
<?php if($i %2 !=0) : ?> | |
<!-- left image content --> | |
<img src="<?php echo $img['url'];?>"> | |
<h2><?php echo $title;?></h2> | |
<?php else : ?> | |
<!--right content --> | |
<h2><?php echo $title;?></h2> | |
<img src="<?php echo $img['url'];?>"> | |
<?php endif; ?> | |
<?php endwhile; | |
endif;?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment