Jump to content

Navigation bar disappearing

Go to solution Solved by paul2009,

Recommended Posts

Site URL: https://jumberlin.com

Hello,

I recently added the following CSS to the 'Page Header Code Injection' for my website's homepage (www.jumberlin.com/landing):

<style type="text/css">
.Header-inner, 
.tweak-mobile-bar-top-fixed .Mobile-bar--top,
.sqs-announcement-bar-custom-location {
   display: none!important;
} </style>

That was because the page itself is intended to direct the visitor to the various areas of my site with buttons, so the heading - with nav bar - was redundant.

However, since I have added the code to that page only, the navigation bar on all other pages now fails to load, unless I subsequently refresh the page after the initial load. The attached images are an example where, having clicked through to view a gallery from my homepage, the site title and nav bar fails to load. After refreshing the page, it does load.

Can anyone help?!

Many thanks,

Jack

 

Screenshot 2021-10-29 at 17.47.46.png

Screenshot 2021-10-29 at 17.48.08.png

Link to comment
  • Solution

That's because you are using a template that supports Ajax Page Loading. If this is enabled, you shouldn't add code to the Page Header Code Injection as it won't be loaded. I explain about this here: Why does Squarespace code only work on refresh?

Instead of using the header, add it to a Code Block on the page instead. Or, better still, add it to the Custom CSS panel, removing the style tags and prefixing each selector with the landing page's ID (#collection-6141f6e3215bcf7bf24d7733) like this:

#collection-6141f6e3215bcf7bf24d7733 .Header-inner,  #collection-6141f6e3215bcf7bf24d7733 .tweak-mobile-bar-top-fixed .Mobile-bar--top, .sqs-announcement-bar-custom-location {
  display: none!important;
}

 

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
1 hour ago, paul2009 said:

That's because you are using a template that supports Ajax Page Loading. If this is enabled, you shouldn't add code to the Page Header Code Injection as it won't be loaded. I explain about this here: Why does Squarespace code only work on refresh?

Instead of using the header, add it to a Code Block on the page instead. Or, better still, add it to the Custom CSS panel, removing the style tags and prefixing each selector with the landing page's ID (#collection-6141f6e3215bcf7bf24d7733) like this:

#collection-6141f6e3215bcf7bf24d7733 .Header-inner,  #collection-6141f6e3215bcf7bf24d7733 .tweak-mobile-bar-top-fixed .Mobile-bar--top, .sqs-announcement-bar-custom-location {
  display: none!important;
}

 

Thank you for this - the code injection was definitely a case of finding some code on the forums and hoping it worked.

How do I find the correct collection ID for my landing page? (Or have you included the correct one?)

Many thanks,

Jack

Link to comment
13 minutes ago, jumberlin said:

Thank you for this - the code injection was definitely a case of finding some code on the forums and hoping it worked.

How do I find the correct collection ID for my landing page? (Or have you included the correct one?)

Many thanks,

Jack

Just tried it and it works a treat - thank you very much!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.