Archived topic
Create Child theme with Slick Slider Included
5 replies · Started by Chetan Patil on March 16, 2023
Hi
I am trying to create a child theme in which I want slick slider and jquery enabled.
Please share me the correct code/function to integrate the slick slider
Here is my theme directory https://prnt.sc/dbgqQBMPRp0Q
and https://prnt.sc/0W2mLAZtn-Ah these files I want to be included.
Regards
Hi Chetan,
This would be out of our scope of support. I found this video though: https://www.youtube.com/watch?v=_hzIwvuSXpc
You can try using a Hook Element to hook these resources as was done here: https://generatepress.com/forums/topic/slick-slider-where-to-place-js-in-gp-hooks/
Hope these help!
Hi Fernando.,
Thank you for your reply.
I was asking the correction of my enqueue script.
//add third-party styles and scripts
function uikit_css_stylesheets() {
wp_enqueue_style('uikit_css', get_stylesheet_directory_uri().'/slick/slick.css', array('cjt_tusoporte_wp'), '1.0');
wp_enqueue_style('uikit-js', get_stylesheet_directory_uri().'/slick/slick.js', array('jquery'), '1.0');
}
add_action('wp_enqueue_scripts','uikit_css_stylesheets');
It is not getting reflected on my website frontend.
Regards
Try replicating the one here: https://developer.wordpress.org/reference/functions/wp_enqueue_script/#comment-274
Make sure to replace wp_enqueue_style with wp_enqueue_script for JS scripts.
Hi,
Thank you for your response. It worked. Thank you.
:)
You're welcome, Chetan! :)