Need a help-Debut theme- Sticky fixed bar on just the home page

Solved
Lilas-addas
Excursionist
44 0 8

Hello, 

I recently made the bar of the main menu sticked and fixed on I roll down.

The problem is I just want it to be fixed in my home page, not in all other pages.

Is there any way to do that? if so , please tell me how.

MY WEBSITE URL: https://presets-market.com

 

 

0 Likes
Guleria
Shopify Partner
1451 299 413

Hello Lisa,

Wrap your css or class name which you used to make header fixed in this condition 

{% if template == 'index' %}
// Your code here
{% endif %}
Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.

This is an accepted solution.

Hello @Lilas-addas,

If you dont want sticky header in another pages then

Go to theme.scss file

Search your code which you applied for sticky header

.site-header {
	position: fixed;
	z-index: 1000;
	left: 0;
	right: 0;
	-webkit-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	-moz-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	-ms-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	-o-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
}

and replace it with below code

.template-index .site-header {
	position: fixed;
	z-index: 1000;
	left: 0;
	right: 0;
	-webkit-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	-moz-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	-ms-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	-o-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
	box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
}

So it will affects only on homepage not on another pages

 

If helpful then please Like and Accept Solution. Free Website Review and advice for sale from Hire us
Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO | Digital Marketing | Site Speed Optimization | Performance Site Audit
For Quick Chat Whats app | Email: pallavi@oscprofessionals.com | Skype : oscprofessionals-87
Lilas-addas
Excursionist
44 0 8

@oscprofessional Thank you so much! It works very well. 

 

@Lilas-addas 

You may wanna try this solution as well if you're still using the Debut theme.
It has a few options to play around with at the Customize page.

Kind regards,
Diego

◦ Product page slider & thumbnails with swiping for free themes: Minimal | Debut | Brooklyn | Supply
◦ Replace apps with simple copy/paste code snippets. Examples clicking here.
0 Likes
jeromart
New Member
2 0 0

mine is only working in home. if i wnt the sticky menu on other pages also wht needs to be done..?

 

Kindly assist

Thanks Jeromart Team

0 Likes