Created
December 17, 2018 08:29
-
-
Save pavlo-bondarchuk/9efbd6efa15301ad9495c75635e24e27 to your computer and use it in GitHub Desktop.
ACF repeater in group
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
<?php | |
// Stop if there's nothing to display. | |
if ( ! have_rows( 'services', 'option' ) ) { | |
return false; | |
} | |
if ( have_rows( 'services', 'option' ) ) : ?> | |
<?php while ( have_rows( 'services', 'option' ) ) : the_row(); | |
// Services Sub Repeater. | |
if ( have_rows( 'services_list' ) ) : ?> | |
<ul class="services"> | |
<?php | |
while ( have_rows( 'services_list' ) ) : the_row(); | |
$image = get_sub_field( 'icon' ); | |
$title = get_sub_field( 'service_title' ); | |
?> | |
<li class="services-single"> | |
<img src="<?php echo esc_url( $image['sizes']['thumbnail'] ); ?>" alt="<?php echo esc_html( $image['alt'] ); ?>"?> | |
<?php echo esc_html( $title ); ?> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
<?php endif; ?> | |
<?php endwhile; ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment