Sharing is caring

Here is where we like to share our knowledge with you
Sometimes WordPress plugin provides undesirable functionality for mobile devices or for desktop. Not all functionality is possible to make responsive. In some cases responsiveness brings an undesired behaviour and limitations.

For example, show slick gallery on desktop, which looks great on mobile, but will show limited amount of images at once.

To rise conversions for both and desktop and mobile users – you would like to use both solutions the same time.

Function wp_is_mobile() will return true if the mobile browser specification are detected.

With this simple piece of code you can specify backend behaviour of your website or woocommerce (wooswipe is disabled on desktop version):

if (!wp_is_mobile()) {
    add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
    remove_action( 'woocommerce_before_single_product_summary', 'wooswipe_woocommerce_show_product_thumbnails', 20 );
}

So our internet shop provides with the backend best option according to the screen resolution.

On mobile:

On desktop full list of photos is visible: