D
D
Denis2021-09-13 21:07:32
Slick
Denis, 2021-09-13 21:07:32

Connecting Slick Slider to your own WordPress theme?

Slick Slider not working in native WordPress theme. I looked at a bunch of similar questions, as I understand it, everything depends on the connection of js files to the engine. I have the dependencies listed, as proof of this, another jquery plugin works in the template.

Actually the functions.php file itself:

add_action( 'wp_enqueue_scripts', 'summer_palace_style' );
add_action( 'wp_enqueue_scripts', 'summer_palace_scripts' );
function summer_palace_style() {

  wp_enqueue_style( 'normalize-style', get_template_directory_uri() . '/assets/css/magnific-popup.css' );
  wp_enqueue_style( 'magnific-style', get_template_directory_uri() . '/assets/css/normalize.css' );
  wp_enqueue_style( 'main-style', get_stylesheet_uri() );

}



function summer_palace_scripts() {

  wp_deregister_script( 'jquery' );
  wp_register_script( 'jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js');
  wp_enqueue_script( 'jquery' );

  wp_enqueue_script( 'magnific-script', get_template_directory_uri() . '/assets/js/jquery.magnific-popup.min.js', array('jquery'), null, true );
  wp_enqueue_script( 'slick-script', get_template_directory_uri() . '/assets/js/slick.min.js', array('jquery'), null, true );
  wp_enqueue_script( 'main-script', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), null, true );
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question