Skip to content

Instantly share code, notes, and snippets.

@johnmccole
Last active September 18, 2023 10:03
Show Gist options
  • Save johnmccole/8b2d1a93a2867db5d8046d6745226e97 to your computer and use it in GitHub Desktop.
Save johnmccole/8b2d1a93a2867db5d8046d6745226e97 to your computer and use it in GitHub Desktop.
.slick {
width: 100%;
max-width: 960px;
.slick-list {
overflow: visible;
.slick-slide {
opacity: 0.2;
transition: opacity 400ms ease-out;
&.slick-active {
opacity: 1;
}
}
}
}
// Slicker Slider assets
add_action('wp_enqueue_scripts', function () {
wp_enqueue_style('slick.min.css', '//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css', false, null);
wp_enqueue_script('slick.min.js', '//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js', ['jquery'], null, true);
}, 100);
$(document).ready(function(){
$('.slick').slick({
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
arrows: false,
});
});
// External functions
require_once( get_stylesheet_directory() . '/inc/custom-functions.php' );
<div class="slick mx-auto">
// Repeating content
<div class="card" style="width: 18rem;">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment