开发者 | Tyrannous |
---|---|
更新时间 | 2023年8月7日 21:50 |
捐献地址: | 去捐款 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 4.8 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
Note: No support for slick’s responsive options feature (different options at different breakpoints) at the moment. Note: Slick Slider requires at least PHP 5.6! That means it won’t work on websites which are powered by PHP older than version 5.6! If you don’t know your website’s PHP version ask your host and request an update if necessary. Click here for more information.Slick Slider uses the awesome slick slider written by Ken Wheeler.
Absolutely! On each gallery Media Modal there’s a checkbox called “Use Slick Slider”. If you leave this box unchecked your gallery will be a simple … gallery.
Since Slick Slider uses the default gallery shortcode, you can simply paste it wherever you want it to appear. Note that you may need to enable support for shortcodes in widgets. Additionally if you want to edit the slider options you’ll have to change it using the shortcode attributes directly.
Use the plugin WP Gallery Custom Links.
Note: Only support for custom URLs and link targets (including the filter wpgcl_filter_raw_gallery_link_url
). No support for additional custom fields or shortcode attributes.
Use the plugin WP Featherlight.
Note: The gallery’s setting “Link To” has to be set to “Media File”.
Use the option “Show caption”.
Note: The captions aren’t styled. You need to apply some CSS on them (use the class .slide__caption
).
Paste the following lines in your functions.php:
add_action( 'wp_enqueue_scripts', function() { wp_enqueue_script( 'slick-slider-core' ); wp_enqueue_style( 'slick-slider-core-theme' ); }, 11 );
Paste the following lines in your functions.php:
add_action( 'wp_enqueue_scripts', function() { wp_deregister_script( 'slick-slider-core' ); wp_deregister_style( 'slick-slider-core' ); }, 11 );
Note: This will also remove the initiation script and helper CSS from the page (see below).
Use add_filter( 'slick_slider_init_slider', '__return_false' );
.
These three line of CSS are sometimes required if the page has a white background. Otherwise the slider arrows won’t be visible.
You can turn it off by using add_filter( 'slick_slider_load_helper_css', '__return_false' );
.
Use the WordPress core filter shortcode_atts_gallery
.
Use the filter slick_slider_caption_html
. Parameters: caption HTML, attachment ID, post ID, slider instance.
Use the filter slick_slider_slide_html
. Parameters: slide HTML, attachment ID, post ID, slider instance.
Use the filter slick_slider_html
. Parameters: slider HTML, post ID, slider instance.
Use the constant SCRIPT_DEBUG
.
Thats great, thanks! First of all, you should say thank you to Ken Wheeler who developed the actual slick slider. If you want, you can buy me a beer too.
slick_slider_show_caption
filterslick_slider_before_slider
, slick_slider_after_slider
, slick_slider_before_slide
and slick_slider_after_slide
slick_slider_caption_html
, slick_slider_slide_html
and slick_slider_html
false
SCRIPT_DEBUG
constantdata-slick
attribute