Last active
July 11, 2018 21:45
-
-
Save cccamuseme/04c67e5b425d001b5ec9898f830c62b3 to your computer and use it in GitHub Desktop.
WordPress Advanced Custom Fields content slider
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( 'care_levels' ) ): | |
echo '<div class="carelevels-slider">'; | |
while ( have_rows( 'care_levels' ) ): the_row(); | |
?> | |
<div class="carelevels-slide"> | |
<?php | |
// content | |
$care_content = get_sub_field( 'care_content' ); | |
echo $care_content; | |
?> | |
<?php | |
// buttons | |
if ( have_rows( 'care_buttons' ) ): | |
while ( have_rows( 'care_buttons' ) ): the_row(); | |
// vars | |
$btn_text = get_sub_field( 'button_text' ); | |
$btn_url = get_sub_field( 'button_url' ); | |
echo '<a href="' . $btn_url . '" class="btn-orange" target="_blank">'; | |
echo $btn_text; | |
echo '</a>'; | |
endwhile; | |
endif; | |
?> | |
</div> | |
<? | |
endwhile; | |
echo '</div>'; | |
endif; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment