K
K
kit4kat2018-01-08 22:45:31
Slick
kit4kat, 2018-01-08 22:45:31

How to integrate slick slider with wordpress?

There is a made-up slider (slick slider plugin), designed as in design, configured so that everything is ok at all resolutions. But now the question is how to make the pictures in the slider change from the admin panel?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergiu Mitu, 2018-01-08
@kit4kat

Through the advanced custom field repeater, we display a list of images, the layout does not change in any way.
Example from working draft:

<?php if ( have_rows( 'slider', 'option' ) ): ?>
        <div class="index-slider">
          <?php while ( have_rows( 'slider', 'option' ) ): the_row();
            // vars
            $slider_img = get_sub_field( 'img' );
            $slider_title  = get_sub_field( 'title' );
            $slider_desc  = get_sub_field( 'desc' );
            $slider_link  = get_sub_field( 'link' );
            ?>
            <div class="index-slide">
              <img src="<?php echo $slider_img; ?>" alt="img">
              <div class="slide-content">
                <?php if ( $slider_title ): ?>
                  <div class="title"><?php echo $slider_title; ?></div>
                <?php endif; ?>
                <?php if ( $slider_desc ): ?>
                  <div class="desc"><?php echo $slider_desc; ?></div>
                <?php endif; ?>
                <?php if ( $slider_link ): ?>
                  <a href="<?php echo $slider_link; ?>" class="btn-green">подробнее</a>
                <?php endif; ?>
              </div>
            </div>
          <?php endwhile; ?>
        </div>
      <?php endif; ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question