apamphilon

Slickslider repeater

<ul class="slick-slider">
    <?php if( have_rows('slider') ): ?>                 
        <?php while( have_rows('slider') ): the_row(); ?>
            <li>
                <?php $image = get_sub_field('image'); ?>
                <img src="<?php echo $image['sizes']['post']; ?>" alt="<?php echo $image['title']; ?>">

                <h2 class="campaign"><?php the_sub_field('campaign_message'); ?></h2>

                <?php if (get_sub_field('button_text')): ?>

                    <a href="<?php the_sub_field('button_link'); ?>" class="cta btn">
                    <?php the_sub_field('button_text'); ?></a>

                <?php endif; ?>
            </li>
        <?php endwhile; ?>
    <?php endif; ?> 
</ul>

Comments: