How to Add Full Width Images in Shopify Product Descriptions

Published on Jul 3, 2024

By Emma Johnson

#Shopify#E-commerce#Web Development
From above crop adult male packing ordered product or gift in white cardboard box with craft paper for safety postal delivery at white marble table

Are you struggling to make your product images stand out on Shopify? Many store owners face the challenge of creating full-width images in their product descriptions, especially when transitioning from mobile to desktop views. This comprehensive guide will walk you through the process of achieving full-width images in your Shopify product descriptions, ensuring a visually appealing and professional look for your online store.

Understanding the Challenge

The Mobile vs Desktop Dilemma

When adding images to your product descriptions, you may notice that they appear full-width on mobile devices but not on desktop. This discrepancy occurs because most Shopify themes split the product page into two sections on desktop: product images on the left and description on the right.

The Limitations of Standard Product Descriptions

By default, Shopify themes confine product descriptions to a specific area, making it challenging to incorporate full-width images seamlessly into your product pages.

The Need for a Custom Solution

To overcome these limitations and create a more visually striking product page, we need to implement a custom solution that allows for full-width images while maintaining the integrity of your product description.

The Solution: Splitting Your Product Description

Introducing the Split Method

The most effective way to achieve full-width images in your product descriptions is by splitting your description into two parts: the regular text content and the full-width images.

Using a Unique Separator

To implement this solution, we’ll use a unique character (in this case, ”~”) to separate the regular description from the full-width images in the product description editor.

Modifying Your Theme’s Code

This method requires some modifications to your theme’s code, specifically in the product template file. Don’t worry if you’re not a coding expert – we’ll guide you through the process step by step.

Implementing the Full-Width Image Solution

Step 1: Prepare Your Product Description

  1. Open your product editor in Shopify.
  2. In the description field, add your regular product description text.
  3. After the text, insert the ”~” character (without quotes) on a new line.
  4. Below the ”~”, add the HTML for your full-width images.

Step 2: Edit Your Theme Files

  1. Go to Online Store > Themes in your Shopify admin.
  2. Click “Actions” next to your current theme and select “Edit code”.
  3. In the Sections folder, locate and open the file named “product-template.liquid” or similar (the exact name may vary depending on your theme).

Step 3: Modify the Product Template

Add the following Liquid code to your product template, replacing the existing product description code:

{% if product.description contains "~" %}
  {% assign descriptionPieces = product.description | split: "~" %}
  <div class="product-description">
    {{ descriptionPieces[0] }}
  </div>
{% else %}
  <div class="product-description">
    {{ product.description }}
  </div>
{% endif %}

<!-- Add this code after the product description, outside the main product container -->
{% if product.description contains "~" %}
  <div class="full-width-images">
    {{ descriptionPieces[1] }}
  </div>
{% endif %}

Step 4: Add Custom CSS

To ensure your full-width images display correctly, add the following CSS to your theme’s stylesheet:

.full-width-images {
  width: 100%;
  max-width: 100%;
  margin-top: 2em;
}

.full-width-images img {
  width: 100%;
  height: auto;
  display: block;
}

Troubleshooting and Tips

Checking Your Work

After implementing these changes, preview your product page to ensure the full-width images appear correctly. If you don’t see the desired result, double-check your product description to make sure you’ve added the ”~” separator correctly.

Optimizing Image Sizes

For best performance, optimize your images before uploading them to Shopify. Aim for a balance between image quality and file size to ensure fast loading times.

Maintaining Consistency

Apply this method consistently across all products where you want full-width images to maintain a uniform look throughout your store.

Advanced Customization Options

Creating Image Galleries

You can extend this solution to create image galleries or side-by-side image layouts by using CSS Grid or Flexbox in the full-width section.

Adding Interactive Elements

Consider incorporating interactive elements like zoom functionality or image sliders in your full-width section to enhance user engagement.

Responsive Design Considerations

Ensure your full-width images look great on all devices by using responsive design techniques, such as CSS media queries.

By following this guide, you can create stunning full-width images in your Shopify product descriptions, elevating the visual appeal of your online store and potentially boosting customer engagement and sales. Remember to test your changes thoroughly and make adjustments as needed to achieve the perfect look for your brand.

Take Our Quick Quiz:

Which primary product image do you think has the highest conversion rate?