Answer the question
In order to leave comments, you need to log in
How to add/remove slick sliders in WP?
Hello!
I have a regular slick slider. How to add/remove slides using WordPress. Tell me what function to write. Recommend, please, an article in which this problem will be solved. I'm a zero in WP(
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
You can simply connect ACF Pro and use the ACF Repeater field type.
Attach a picture to each element of the repeater.
Another option is to use ACF Pro and use the Gallery field type. Each picture will be a new slide.
https://www.advancedcustomfields.com/add-ons/repea...
https://www.advancedcustomfields.com/resources/rep...
https://www.advancedcustomfields.com/add-ons/galle. ..
https://www.advancedcustomfields.com/resources/gallery/
And it doesn't matter what kind of slider you will use, since this method is suitable for all sliders.
As for sliders, there are many - Slick Slider, OWL Carousel, Woo FlexSlider, Swipe and many others....
You need to install (or download from the Internet and add plugins to the folder) ACF Pro and use the ACF field type block/(repeater - only if the block is duplicated)
(<?php if (have_rows('top_block')) :
while (have_rows('top_block ')) : the_row();
$image = get_sub_field('top_right_img');
?>)
=> inside which you create a gallery ( ) .
=> then add pictures to the gallery and the slider is ready!
From working draft =>
<?php if (have_rows('top_block')) :
while (have_rows('top_block')) : the_row();
$image = get_sub_field('top_right_img');
?>
<?php the_sub_field('top_left_text'); ?>
<?php endwhile; ?>
<?php endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question