Answer the question
In order to leave comments, you need to log in
Slick slider is not working on one of the wordpress pages. What to do?
I pulled the site on WP, connected all the scripts and styles.
On the second page of the site, this is:
On the other page, 2 sliders behave naturally.
They eat code from two different JS files with scripts:
Working ( ind-scripts.js ):
// Slick Slider
$('.it-idv-slider').slick({
//arrows: true,
//autoplay: true,
autoplaySpeed: 3500
});
$('.it-idv-slider-comment').slick({
arrows: true,
autoplay: true,
autoplaySpeed: 3500
});
$('.balloons-slider').slick({
arrows: true,
autoplay: true,
autoplaySpeed: 3500
});
$('.balloons-can__slider-m').slick({
arrows: true
});
add_action( 'wp_enqueue_scripts', 'colorball_styles' );
add_action( 'wp_footer', 'jquery_lib' );
function jquery_lib(){
wp_deregister_script( 'jquery-core' );
wp_register_script ( 'jquery-core', get_template_directory_uri() . '/assets/js/jquery-3.4.1.min.js' );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery.event.move', get_template_directory_uri() . '/assets/js/jquery.event.move.js', array('jquery'), null, true );
wp_enqueue_script( 'jquery.twentytwenty', get_template_directory_uri() . '/assets/js/jquery.twentytwenty.js', array('jquery'), null, true );
wp_enqueue_script( 'jquery.simple-dtpicker', get_template_directory_uri() . '/assets/js/jquery.simple-dtpicker.js', array('jquery'), null, true );
wp_enqueue_script( 'wow', '//cdnjs.cloudflare.com/ajax/libs/wow/0.1.12/wow.min.js', array('jquery'), null, true );
wp_enqueue_script( 'slick', '//cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js', array('jquery'), null, true );
wp_enqueue_script( 'scripts', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), null, true );
wp_enqueue_script( 'ind-scripts', get_template_directory_uri() . '/assets/js/ind-scripts.js', array('jquery'), null, true );
wp_enqueue_script( 'balloons-scripts', get_template_directory_uri() . '/assets/js/balloons-scripts.js', array('jquery'), null, true );
wp_enqueue_script( 'smile-bar', get_template_directory_uri() . '/assets/js/smile-bar.js', array('jquery'), null, true );
wp_enqueue_script( 'lightzoom', get_template_directory_uri() . '/assets/js/lightzoom.js', array('jquery'), null, true );
}
function colorball_styles() {
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_style( 'normalize', get_template_directory_uri() . '/assets/css/normalize.css');
wp_enqueue_style( 'twentytwenty', get_template_directory_uri() . '/assets/css/twentytwenty.css');
wp_enqueue_style( 'animate.min', get_template_directory_uri() . '/assets/css/animate.min.css');
wp_enqueue_style( 'jquery.simple-dtpicker', get_template_directory_uri() . '/assets/css/jquery.simple-dtpicker.css');
wp_enqueue_style( 'slick-theme', get_template_directory_uri() . '/assets/css/slick-theme.css');
wp_enqueue_style( 'slick', '//cdn.jsdelivr.net/npm/[email protected]/slick/slick.css');
wp_enqueue_style( 'smile-bar', get_template_directory_uri() . '/assets/css/smile-bar.css');
wp_enqueue_style( 'lightzoom', get_template_directory_uri() . '/assets/css/lightzoom.css');
}
Answer the question
In order to leave comments, you need to log in
A script was connected that did not work and did not allow the slick to work.
If someone has a similar, just connect everything in turn and check.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question