How to Add a Slick Slider in WordPress Without a Plugin

Slick image slider flowing along a blue kinetic track

To add a Slick slider to WordPress without a plugin, put your images in a Group block with the CSS class my-slick-slider, then load the Slick files and start the slider with a short PHP snippet. WordPress already includes jQuery, which Slick needs, so the whole setup is one snippet and one CSS class. I tested every step below on WordPress 7.1.3 with four themes: Twenty Twenty-Five, Twenty Twenty-One, Astra and Hello Elementor.

If you’d rather not touch code, a maintained slider plugin does the same job. Just avoid the plugin this guide used to recommend: WP Slick Slider and Image Carousel has since been closed on WordPress.org.

  • Use Slick 1.8.1 with WordPress. It’s the version I tested with the jQuery 3.7.1 that WordPress 7.1 ships. Slick 2.0, released in September 2026, is new and built with jQuery 4 in mind.
  • No plugin needed: a Group block, one CSS class and one snippet give you arrows, dots and swipe support.
  • Load Slick only where you use it, so the rest of your site doesn’t carry the extra 43 KB script.

What Slick Is and When a Slider Makes Sense

Slick is a free jQuery carousel library by Ken Wheeler. It turns a row of images or blocks into a slider with arrows, dots, swipe on touch screens, autoplay and responsive breakpoints. Several WordPress slider plugins, including the one this guide used to cover, are built on Slick.

Sliders work best for content where each slide is optional, such as a photo gallery, client logos or testimonials. Don’t hide important information in slide three: visitors who never click the arrows never see it. If every image matters, show the images side by side instead.

How to Add a Slick Slider in WordPress Without a Plugin

You need two things: the slides in the block editor, and a snippet that loads Slick. I use the free Code Snippets plugin for the snippet because it’s safer than editing functions.php, but a child theme’s functions.php works too.

Step 1: Put Your Slides in a Group Block

Edit the page, add a Group block and place one Image block inside it for each slide. With the Group block selected, open Advanced in the Block settings sidebar and type my-slick-slider in Additional CSS class(es).

Group block selected in the WordPress editor with my-slick-slider in the Additional CSS class field
The Group block holds the slides. The CSS class tells the snippet which block to turn into a slider.

Each direct child of the Group becomes one slide, so you can also use Cover blocks, Columns or Quote blocks for testimonial sliders.

Step 2: Add the Snippet That Loads Slick

Install and activate Code Snippets, go to Snippets > Add New, name the snippet and paste this code. Change garden-photo-slider to the slug of your page, set Location to Only run on site front-end and click Save and Activate.

add_action( 'wp_enqueue_scripts', function () {
	// Load Slick only on the page that has the slider.
	if ( ! is_page( 'garden-photo-slider' ) ) {
		return;
	}

	$slick = 'https://cdn.jsdelivr.net/npm/[email protected]/slick/';
	wp_enqueue_style( 'slick', $slick . 'slick.css', array(), '1.8.1' );
	wp_enqueue_style( 'slick-theme', $slick . 'slick-theme.css', array( 'slick' ), '1.8.1' );
	wp_enqueue_script( 'slick', $slick . 'slick.min.js', array( 'jquery' ), '1.8.1', true );

	// Start the slider on any block with the CSS class "my-slick-slider".
	// Older themes wrap Group contents in an extra div, so use that div if it exists.
	wp_add_inline_script( 'slick', 'jQuery( function ( $ ) {
		$( ".my-slick-slider" ).each( function () {
			var $inner = $( this ).children( ".wp-block-group__inner-container" );
			( $inner.length ? $inner : $( this ) ).slick( { dots: true, arrows: true } );
		} );
	} );' );

	// Dark arrows and some room for them on light backgrounds.
	wp_add_inline_style( 'slick-theme', '.my-slick-slider { padding: 0 40px; }
		.my-slick-slider .slick-prev:before, .my-slick-slider .slick-next:before { color: #111; }
		.my-slick-slider .slick-arrow { margin: 0 !important; }
		.my-slick-slider .slick-prev { left: 0; } .my-slick-slider .slick-next { right: 0; }
		.my-slick-slider img { width: 100%; height: 400px; object-fit: cover; }' );
} );
Code Snippets editor with the Slick slider snippet set to run only on the site front end
The snippet in Code Snippets, active and limited to the front end.

Here’s what the code does:

  • is_page() loads Slick only on the page with the slider. For a blog post, use is_single( 'your-post-slug' ), for the home page use is_front_page(), or remove the check to load it everywhere.
  • The three wp_enqueue_* lines load Slick 1.8.1 and tell WordPress it needs jQuery, so the files load in the right order.
  • wp_add_inline_script() starts Slick on every element with the my-slick-slider class. Some older themes, such as Twenty Twenty-One, wrap a Group block’s contents in an extra div; the script detects that wrapper and uses it, otherwise all your images would end up in a single slide.
  • The inline CSS darkens the arrows (Slick’s default arrows are white), gives every slide the same height and removes the margin themes add between blocks. Without that rule, the “next” arrow sits lower than the “previous” arrow: by 19px in Twenty Twenty-Five and 30px in Twenty Twenty-One in my tests. The !important is needed because some themes use more specific spacing rules.

Step 3: Check the Slider on the Front End

Open the page while logged out or in a private window. You should see one image at a time with arrows on each side and dots underneath.

Slick slider on a WordPress page showing one photo with previous and next arrows and navigation dots
The finished slider on the How-To WP lab site, with no slider plugin installed.

If the images still stack vertically, open your browser’s developer console. “slick is not a function” means the Slick script didn’t load: check the page slug in is_page() and that the snippet is active. If your site goes down after saving a snippet in a child theme, follow my guide to fixing the critical error.

Change How the Slider Behaves

Slick’s options go inside the .slick( { … } ) call in the snippet. These are the ones you’ll use most (the full list is on the Slick website):

OptionWhat it doesExample
slidesToShowHow many slides are visible at onceslidesToShow: 3
slidesToScrollHow many slides move per clickslidesToScroll: 1
autoplay and autoplaySpeedMove automatically, with the delay in millisecondsautoplay: true, autoplaySpeed: 4000
fadeFade between single slides instead of slidingfade: true
dots and arrowsShow or hide the dot and arrow navigationarrows: false
responsiveDifferent settings below a screen widthSee the logo carousel below

For example, this shows four client logos on desktop, two on tablets and one on phones. Replace the { dots: true, arrows: true } part of the snippet with these settings, and change height: 400px in the CSS to auto so logos aren’t cropped:

{
	slidesToShow: 4,
	slidesToScroll: 1,
	autoplay: true,
	autoplaySpeed: 3000,
	responsive: [
		{ breakpoint: 1024, settings: { slidesToShow: 2 } },
		{ breakpoint: 600, settings: { slidesToShow: 1 } }
	]
}

Use double quotes for any text values you add, because the script sits inside single quotes in the PHP snippet.

If you turn on autoplay, keep the arrows visible so visitors can go back. Slick pauses autoplay only while the pointer is over the slider or keyboard focus is inside it, so leave autoplay off for slides people need time to read.

Host the Slick Files Yourself (Optional)

The snippet loads Slick from the jsDelivr CDN, which is quick to set up. If you prefer not to load files from a third-party server, for privacy or reliability, download the slick folder from the Slick 1.8.1 release, upload it to your child theme and change the $slick line to:

$slick = get_stylesheet_directory_uri() . '/slick/';

Keep the fonts folder and ajax-loader.gif next to slick-theme.css. The arrows and dots use the icon font in fonts, and Slick shows the GIF while slides load.

Which Slick Version Should You Use?

Slick sat at version 1.8.1 from 2017 until version 2.0.0 arrived in September 2026. The 2.0 readme says it’s compatible with jQuery 4 and recommends 1.8.1 for jQuery 3.0 or lower. WordPress 7.1 bundles jQuery 3.7.1, and 1.8.1 is the version I tested with it, so that’s the one I recommend today. If you want to try 2.0.0, change the version number in the snippet and test the slider on a staging site first.

Using a Slider Plugin Instead

A plugin makes sense if you want to manage slides from a screen of their own or need a slider in many places. When you choose one, check the plugin page on WordPress.org for:

  • A recent “Last updated” date and a “Tested up to” version that matches your WordPress version.
  • Whether it works with the block editor, or only through shortcodes.
  • Support threads with replies from the developer.

WP Slick Slider and Image Carousel, the plugin this article used to walk through, is now closed on WordPress.org and no longer available for new installs. If you still use it, plan to replace it. Page builders also have their own option: Elementor’s Image Carousel widget, for example, needs no extra plugin.

Check the Slider Before You Publish

  • Preview the page at phone width and swipe through every slide.
  • Press Tab to reach the arrows and the active dot, check that Enter moves the slider, and use the Left and Right arrow keys to change slides.
  • Write alt text for every image. Slick keeps it on the slides.
  • Compress large images. A slider loads every slide, not only the first one.
  • Avoid placing a slider at the very top of the page unless it’s essential, because it delays your main content.

Frequently Asked Questions

Does Slick need jQuery in WordPress?

Yes. Slick 1.8.1 is a jQuery plugin. WordPress includes jQuery, and the snippet loads it automatically by listing jquery as a dependency, so you don’t add jQuery yourself.

Will Slick slow down my site?

A little. The minified script is about 43 KB, plus jQuery if your theme doesn’t already load it. Loading Slick only on pages with a slider, as the snippet does, keeps the rest of your site unaffected.

Can I use Slick with Elementor or WPBakery?

It can work, but I tested only the block editor. Page builders wrap content in extra containers, so add the my-slick-slider class to the element whose direct children are your images, then check the front end. If everything appears as one slide, the class is one level too high. Elementor’s free Image Carousel widget is the simpler choice there. For WPBakery shortcodes, see my shortcode guide.

Why don’t my Slick arrows show?

Slick’s default arrows are white and sit just outside the slider, so on a white page they’re invisible or cut off. The CSS in the snippet darkens them and adds padding so they fit inside the content area.

Related Posts

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to our Monthly Newsletter

Get monthly updates of WordPress tips, tricks, and tutorials in your email.

Thanks. You have successfully subscribed.