<!-- wp:paragraph -->
<p>refer to : https://community.shopify.com/c/Shopify-Design/Different-images-for-mobile-than-desktop-web/td-p/522935/page/6</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":132,"width":768,"height":402,"sizeSlug":"large","linkDestination":"none"} -->
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img src="https://www.mojoin.com/wp-content/uploads/2020/12/show-diff-pcmobile-banner-images-1024x536.jpg" alt="different banner image for PC &amp; Mobile" class="wp-image-132" width="768" height="402"/><figcaption>different banner image for PC & Mobile</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>In Shopify default <strong>Debut</strong> theme, there are sections called "image with text" and "image with text overlay". You can use them to put an image with text on your home page, but you can set different images for Desktop or Mobile, so the reality is it is very difficult to make one image to support both Desktop and Mobile and make them both looks perfect on two devices.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In order to solve the above problem, we need to customize the default theme, here we will use the Shopify Debut theme to show you how to implement this functionality, I will guide you through the whole process following the below steps:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li><strong><a href="#define-our-section">define your sections in the Shopify Debut theme</a></strong></li><li><strong><a href="#add-image-to-section" title="#add-image-to-section">add image set in the section</a></strong></li><li><strong><a href="#add-css-style">put our CSS code into the theme</a></strong></li><li><strong>debug and test</strong></li><li><strong>publish the theme</strong></li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2 id="define-our-section">Define your own sections </h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>login to your store backend,select your theme to edit code</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":137,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://www.mojoin.com/wp-content/uploads/2020/12/edit-them-code.png" alt="edit theme code" class="wp-image-137"/><figcaption>edit theme code</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Add new section called "yx-desktop-banner",then your can see a liquid file called yx-desktop-banner.liquid will be added in your sections directory.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":139,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://www.mojoin.com/wp-content/uploads/2020/12/add-new-section-2-theme.png" alt="add new section" class="wp-image-139"/><figcaption>add new section</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Repeat above step to create the other section named as "yx-mobile-banner".</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="add-image-to-section">Add Image Picker to the section</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Click the above created yx-desktop-banner.liquid file to edit it. Delete all the default codes in the file, replace them with the below lines:</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;div class="page-width yx-desktop-banner-container yx-mobile-hidden">
 &lt;div class="container-full">
   {% for block in section.blocks limit: 1 %}
	&lt;img class="img-responsive lazyload"  data-src="{{ block.settings.yx_image_picker | img_url: '2000x' }}" />
   {% endfor %}
&lt;/div>
&lt;/div>
{% schema %}
  {
    "name": "YX Desktop Banner",
    "class": "yx-desktop-banner-section",
    "max_blocks": 1,
    "blocks": [
    {
      "type": "image_picker",
      "name": "Desktop Banner Image",
      "settings": [
        {
          "label": "Desktop Banner Image",
          "id": "yx_image_picker",
          "type": "image_picker"
        }
      ]
    }
  ],
 "presets": [
    {
      "name": "YX Desktop Banner",
      "category": "Home",
"blocks":[{"type" : "image_picker"}]
    }
]
  }
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}</pre>
<!-- /wp:enlighter/codeblock -->

<!-- wp:paragraph -->
<p>Save it.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Replaced yx-mobile-banner.liquid file content with the following lines:</p>
<!-- /wp:paragraph -->

<!-- wp:enlighter/codeblock -->
<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;div class="page-width yx-mobile-banner-container yx-desktop-hidden">
 &lt;div class="container-full">
   {% for block in section.blocks limit: 1 %}
	&lt;img class="img-responsive lazyload"  data-src="{{ block.settings.yx_image_picker | img_url: '750x' }}" />
   {% endfor %}
&lt;/div>
&lt;/div>
{% schema %}
  {
    "name": "YX Mobile Banner",
    "class": "yx-mobile-banner-section",
    "max_blocks": 1,
    "blocks": [
    {
      "type": "image_picker",
      "name": "Mobile Banner Image",
      "settings": [
        {
          "label": "Mobile Banner Image",
          "id": "yx_image_picker",
          "type": "image_picker"
        }
      ]
    }
  ],
 "presets": [
    {
      "name": "YX Mobile Banner",
      "category": "Home",
      "blocks":[{"type" : "image_picker"}]
    }
 ]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
</pre>
<!-- /wp:enlighter/codeblock -->

<!-- wp:paragraph -->
<p>Don't forget to save it as well.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Now when you customize your theme, click <strong>[Add section]</strong> you will see two new sections: ''<strong>YX Desktop Banner</strong>" and "<strong>YX Mobile Banner</strong>".</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":144,"sizeSlug":"large","linkDestination":"none"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><img src="https://www.mojoin.com/wp-content/uploads/2020/12/add-new-section-2-theme-1.png" alt="new section shown up" class="wp-image-144"/><figcaption>new section shown up</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:heading -->
<h2 id="add-css-style">Add CSS codes control our style</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->