Taste theme - Two separate banners for mobile and desktop

Solved

Taste theme - Two separate banners for mobile and desktop

TvojTatkovSyn
Tourist
7 0 2

Hey, im trying to make two banners for mobile and desktop. I saw on here that you can hide one of the banners so only one appears on mobile and one on desktop. But i only saw it in dawn theme, can you do that tsate theme aswell? can anyone help me?

https://6ec26c-7f.myshopify.com/

Accepted Solution (1)
BSSCommerce-B2B
Shopify Partner
1972 564 568

This is an accepted solution.

Sorry change the previous code like this

<style>
@media only screen and (max-width: 767px) {
  #shopify-section-template--23806452269405__image_banner_QraQyH {
    display: none;
  }
  #shopify-section-template--23806452269405__image_banner_NmTYz8 {
    display: block;
  }
} 
@media only screen and (min-width: 768px) {
  #shopify-section-template--23806452269405__image_banner_QraQyH{
    display: block;
  }
  #shopify-section-template--23806452269405__image_banner_NmTYz8 {
    display: none;
  }
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

Replies 7 (7)

BSSCommerce-B2B
Shopify Partner
1972 564 568

@TvojTatkovSyn,

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head>

<style>
@media only screen and (max-width: 767px) {
  #shopify-section-template--23806452269405__image_banner_QraQyH {
    display: none;
  }
  #shopify-section-template--23806452269405__image_banner_NmTYz8 {
    display: flex;
  }
} 
@media only screen and (min-width: 768px) {
  #shopify-section-template--23806452269405__image_banner_QraQyH{
    display: flex;
  }
  #shopify-section-template--23806452269405__image_banner_NmTYz8 {
    display: none;
  }
}
</style>

Result:

Desktop: 

BSSCommerceB2B_0-1730034779169.png

Mobile

BSSCommerceB2B_1-1730034797728.png

 

If it helps you, please like and mark it as the solution.

Best Regards 😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

TvojTatkovSyn
Tourist
7 0 2

Screenshot 2024-10-27 at 14.22.01.png

worked but...

Screenshot 2024-10-27 at 14.22.18.png

BSSCommerce-B2B
Shopify Partner
1972 564 568

This is an accepted solution.

Sorry change the previous code like this

<style>
@media only screen and (max-width: 767px) {
  #shopify-section-template--23806452269405__image_banner_QraQyH {
    display: none;
  }
  #shopify-section-template--23806452269405__image_banner_NmTYz8 {
    display: block;
  }
} 
@media only screen and (min-width: 768px) {
  #shopify-section-template--23806452269405__image_banner_QraQyH{
    display: block;
  }
  #shopify-section-template--23806452269405__image_banner_NmTYz8 {
    display: none;
  }
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

TvojTatkovSyn
Tourist
7 0 2

Thank you man, Worked perfectly

BSSCommerce-B2B
Shopify Partner
1972 564 568

Glad to help you 😀

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

LizHoang
Shopify Partner
1251 159 195

Hi @TvojTatkovSyn 

 

Thanks for your questions. 

 

We have the solution for your query, we hope it helps. To show one banner on Mobile and one banner on Desktop, you can follow the instruction below : 

 

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Customize > Homepage

Step 2: Access to Image banner section: https://prnt.sc/QTr1_m9Ro6Ac

Step 3: There will be 2 sections to add image. First section to add Desktop image, second section to add for Mobile : https://prnt.sc/YkUTYnZbn_rP 

Step 4: On that image banner section, scroll down to the Custom CSS section and add the CSS code below to that section : https://prnt.sc/CQDPSaIDtBzA

 

.banner.banner--content-align-center > div:nth-child(2) {
    display: none;
}
.banner.banner--content-align-center > div:nth-child(1) {width: 100% !important;}
.banner.banner--content-align-center > div:nth-child(1) > img {
    object-fit: contain;
}
@media screen and (max-width: 768px){
   body .banner.banner--content-align-center > div:nth-child(2) {
        display: block;
    }
    .banner.banner--content-align-center > div:nth-child(1) {
        display: none;
    }
    .banner.banner--content-align-center {
        flex-direction: column-reverse;
    }
}

 We hope that it helps.

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Check our Joy Rewards & Loyalty Program
TvojTatkovSyn
Tourist
7 0 2

BSSCommerce...Worked but ...Screenshot 2024-10-27 at 14.22.01.pngScreenshot 2024-10-27 at 14.22.18.png