How to easily show before and after photo slider in Shopify

Do you want to show the before and after photos on your Shopify store? A before and after photo can be useful to display side by side comparison of two identical images with minor differences. Perfect for anyone in the beauty or fitness business, photographers, designers, gardeners, builders and more.

DEMO

In this article, I will share how to easily show before and after photo in Shopify.

  • From your Shopify admin, go to Online Store > Themes.
  • Find the theme you want to edit, and then click Actions > Edit code.
  • In the Layout section, click theme.liquid to open the file in the online code editor.
  • Find </head> and paste the below code just above it.
  • Click Save.

It’s easy to get started, just wrap two images inside of a container with class name “twentytwenty-container“. The first image will be on the left and the second one will be on the right. Here’s an example container:

Happy coding!

You may also like...

14 Responses

  1. Tupac says:

    i’m lost after putting the code in the header theme.liquid , and then where to do i “wrap the images”

  2. Marc says:

    I followed exactly the tutorial but nothing happened, the images doesn’t even appear.
    Can someone help

  3. Marc Kadi says:

    I tried but still nothing 🙁
    //ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/js/jquery.twentytwenty.min.js’ | script_tag }}
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/js/jquery.event.move.min.js’ | script_tag }}
    {{ ‘//cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/css/twentytwenty.min.css’| stylesheet_tag }}
    $(function(){$(‘.twentytwenty-container’).twentytwenty();});

  4. N A says:

    Hi could you help me with this as well. i did it all wrong i think..
    Kind regards

Leave a Reply

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