Archived topic
Stop slide effect for woocommerce product gallery image on product page
5 replies · Started by Peter on September 14, 2017
Hi,
how do I disable the slider effect on woocommerce product pages. Since I have only 1 image for every product its just distracting that user can drag image back and forth with no function. It also makes it more difficult and confusing to scroll page (and get to the order button ;))
Ive tried something like:
@media (max-width: 768px) {
.woocommerce-product-gallery__wrapper {
pointer-events: none;
cursor: default;
}
}
but there are so many classes, i cant find the right one, and Im terrible at css.
Thanks for your assistance.
Hi
Try this:
If so try this PHP:
add_action( 'wp', 'lh_disable_wc_slider', 50 );
function lh_disable_wc_slider() {
remove_theme_support( 'wc-product-gallery-slider' );
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Can we qulify this with something like :
if($images_count<=1) {
... disable slider ...
}
That might be something you need to ask WooCommerce support - they'll have a better idea than me.
Ok thanks Tom. My initial question is resolved.
No problem - let me know if you end up needing more help with the second question :)