-
HI! If you wanted to have 2 slides on your mobile instead of one or anyway there are currently 3 breakpoints If I wanted to add this
What is the simplest way? |
Beta Was this translation helpful? Give feedback.
Answered by
crftwrk
May 13, 2024
Replies: 1 comment
-
That's a good question. Because breakpoints are set in JavaScript, there is no way to change them in shortcode or override them. So, the best option is to dequeue the init file and enqueue a custom init in child.
/**
* Dequeue swiper-init.js and enqueue custom
*/
function custom_swiper_init() {
wp_deregister_script( 'swiper-init-js' );
wp_dequeue_script( 'swiper-init-js' );
wp_enqueue_script('swiper-custom-init-js', get_stylesheet_directory_uri() . '/assets/js/swiper-custom-init.js', array(), false, true);
}
add_action( 'wp_enqueue_scripts', 'custom_swiper_init', 11 );
Solved? |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ePiliK
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's a good question. Because breakpoints are set in JavaScript, there is no way to change them in shortcode or override them. So, the best option is to dequeue the init file and enqueue a custom init in child.
swiper-custom-init.js
assets/js/
folderswiper-init.js
and enqueueswiper-custom-init.js
with a higher priority in child'sfunctions.php
: