lilyyp
October 30, 2021, 11:52pm
1
Hi! I am looking to change only the mobile hero photo to be vertical on my website. Right now it is horizontal on both the mobile and desktop sites. I want to leave the desktop version alone and just change the mobile. Is there a way to add another version of my image to allow it to show properly vertical on mobile?
My url is liveinbungalow.com
Thanks!
1 Like
@lilyyp
sorry for any issue can you please let me know which banner do you need this
if you need different banner desktop and mobile try this
https://www.mojoin.com/show-shopify-banner-image/
lilyyp
October 31, 2021, 3:18pm
3
Hi @KetanKumar worked great so far! Thanks!
Seem to be having two problems though.
The space from the photo to the header on mobile is too big now. Is there a way to shorten the space?
Is there a code to add a “Shop Now” button to both the desktop and mobile images?
Thank you for the help!
1 Like
@lilyyp
yes please share issue image
lilyyp
November 1, 2021, 1:32am
5
Hi @KetanKumar attached is the photo. The arrow shows the space I would like to shorten and the circle shows the location I would like the “shop now” button to be. Same button location for desktop as well.
thanks!
1 Like
@lilyyp
yes please try this code
Go to Online Store->Theme->Edit code
Asset->/theme.scss.liquid ->paste below code at the bottom of the file.
@media screen and (max-width: 768px) {
.index-sections .shopify-section {
margin-top: 0;
}
}
sorry but i can’t see shop now button can you please add?
lilyyp
November 1, 2021, 12:44pm
7
Hi @KetanKumar thanks for the code! Worked great for the spacing.
There currently is no “Shop Now” button. I would like to add the button in the middle of the photo header on both mobile and desktop but am unsure how to do that. I have circled where I would like the button to be.
Thanks!
1 Like
@lilyyp
yes please show me shop now button
so i will give you proper code
lilyyp
November 1, 2021, 6:02pm
9
@KetanKumar Oh sure! I would like the button to look something like this for both desktop and mobile. Thanks!
1 Like
@lilyyp
oh yes please add code button html on new section
lilyyp
November 2, 2021, 12:05am
11
@KetanKumar can you explain how to do this? Thanks!
1 Like
@lilyyp
can you please share new both section code
lilyyp
November 2, 2021, 1:52pm
13
Hi @KetanKumar I’m not really sure what code. I don’t really know much about coding. I’m sorry! I just followed the code you linked to add both a mobile banner and desktop. Is there a way to just add a button to this code?
Thanks!
1 Like
@lilyyp
yes please new section code mobile and desktop
lilyyp
November 2, 2021, 7:18pm
15
@KetanKumar Sure!
The desktop code is:
{% for block in section.blocks limit: 1 %}
{% endfor %}
{% 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 %}
The Mobile code is:
{% for block in section.blocks limit: 1 %}
{% endfor %}
{% 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 %}
And this to allow it only to show on mobile or desktop
@media only screen and (max-width: 749px) {
.yx-mobile-hidden{
display:none;
}
.yx-desktop-hidden{
display:block;
}
}
@media only screen and (min-width: 750px) {
.yx-mobile-hidden{
display:block;
}
.yx-desktop-hidden{
display:none;
}
}
Thanks!
1 Like
@lilyyp
can you try this code desktop and let me know so i will give you css
{% for block in section.blocks limit: 1 %}
{{ section.settings.linktext }}
{% endfor %}
{% 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"
},
{
"id": "link",
"type": "url",
"label": "Button link"
},
{
"id": "linktext",
"type": "text",
"label": "Button text",
"default": "Click Here"
}
]
}
],
"presets": [
{
"name": "YX Desktop Banner",
"category": "Home",
"blocks":[{"type" : "image_picker"}]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
lilyyp
November 3, 2021, 12:14pm
17
@KetanKumar it gave the option to have a button when I customize but the actual button doesn’t show when I try it.
Thanks
1 Like
@lilyyp
oh sorry i have missing one code can you please update this code
{% for block in section.blocks limit: 1 %}
{{ block.settings.linktext }}
{% endfor %}
{% 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"
},
{
"id": "link",
"type": "url",
"label": "Button link"
},
{
"id": "linktext",
"type": "text",
"label": "Button text",
"default": "Click Here"
}
]
}
],
"presets": [
{
"name": "YX Desktop Banner",
"category": "Home",
"blocks":[{"type" : "image_picker"}]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
1 Like
lilyyp
November 3, 2021, 5:01pm
19
@KetanKumar It worked!! Thank you so much! Is it the same for desktop?
1 Like