jumberlin Posted October 29, 2021 Share Posted October 29, 2021 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 Link to comment
Solution paul2009 Posted October 29, 2021 Solution Share Posted October 29, 2021 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; } tuanphan 1 About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity 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. Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.Improve your online store with our extensions. Link to comment
jumberlin Posted October 29, 2021 Author Share Posted October 29, 2021 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 tuanphan 1 Link to comment
jumberlin Posted October 29, 2021 Author Share Posted October 29, 2021 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! paul2009 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment