Answer the question
In order to leave comments, you need to log in
How to enable slick slide in wordpress?
Hello. Can you suggest, or poke where you can read how to enable slick slide in wordpress. For, I made a layout, everything works fine, the slider works, but as soon as I try to transfer the layout to WP, the slider simply does not turn on and that's it. Sorry if this is a dumb question, I couldn't find anything myself.
Answer the question
In order to leave comments, you need to log in
Hello!
All scripts and styles are connected via functions.php
Create css js fonts folders, drop styles and slick scripts there.
Open functions
add code
// include styles and scripts
function register_styles_scripts() {
//стили
wp_register_style('style', get_template_directory_uri() .
'/style.css');
wp_enqueue_style('style');
//скрипты
wp_register_script('slick', get_template_directory_uri() .
'/js/jquery.js');
wp_enqueue_script('slick');
}
add_action('wp_enqueue_scripts', 'register_styles_scripts');
$.noConflict();
jQuery( document ).ready(function( $ ) {
......
});
You can also take into account the dependency of slick.js on jquery.js, for this, in the functions.php theme folder of the WP theme, for example:
// Подключаем jquery
wp_enqueue_script('my-jquery', get_template_directory_uri() . '/assets/js/jquery-3.2.1.slim.min.js');
// Подключая slick, учитываем зависимость от jquery
wp_enqueue_script('my-slick', get_template_directory_uri() . '/assets/slick/slick.js', array('my-jquery'), null, true);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question