AndrewFreedman Posted June 9, 2021 Posted June 9, 2021 Site URL: https://andrewfreedman.com Hello, I am currently working on the 404 page of my site and I would like to hide just the navigation on the 404 page and keep it on the main page. I tried a few different pieces of code but the closest I have seen to get is just hiding the entire header. I need this because I realized my menu is made up of anchor links so they are useless on the 404 page. Any help would be greatly appreciated! Best, Andrew Freedman
christyprice Posted June 9, 2021 Posted June 9, 2021 <style> .header-nav {display: none!important; } .header-burger {display: none!important; } </style> You’ll paste this code into your Advanced Page Settings for the particular page you want to target to remove the navigation. The first class removes desktop nav, the second removes the mobile hamburger icon. christyprice.com 🇺🇸 Austin, TX US 🐾 ✅ Get my Starter Template for Web Designers 🎬 Watch 7 Ways to Save Time as a Squarespace Designer from Circle Day 2024 🎥 Watch Circle Live: Hello Income (feat. Christy Price and Jeremy Schwartz)
Wolfsilon Posted June 9, 2021 Posted June 9, 2021 Hello Andrew, It's actually fairly simple to setup and you won't need to worry about hiding the entire header or having it effect all other pages. To do this, start by creating an un-linked page and fill it will whatever content you want to display to viewers for your 404 Page. After you've completed styling or adding the 404 Page content, save your changes. In the "Advanced Settings" for the page, use the following code in the page in Code Injection field: <style> .header-nav {display: none!important; } .header-burger {display: none!important; } </style> Navigate to Home -> Design -> 404 Page. You'll have an option to select the page we created earlier to be your 404 Page. Select it, save, and boom! You're all set. Hope this helps, -Dan
AndrewFreedman Posted June 10, 2021 Author Posted June 10, 2021 I don't have a premium or business account, is it possible to do this without the code injection?
AndrewFreedman Posted June 10, 2021 Author Posted June 10, 2021 Is this possible to do with the basic plan?
creedon Posted June 10, 2021 Posted June 10, 2021 @AndrewFreedman It appears you solved the issue? Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
christyprice Posted June 11, 2021 Posted June 11, 2021 Yes! You can follow the general steps in this post but use the code provided above. christyprice.com 🇺🇸 Austin, TX US 🐾 ✅ Get my Starter Template for Web Designers 🎬 Watch 7 Ways to Save Time as a Squarespace Designer from Circle Day 2024 🎥 Watch Circle Live: Hello Income (feat. Christy Price and Jeremy Schwartz)
AndrewFreedman Posted June 15, 2021 Author Posted June 15, 2021 @christyprice this looks like this also required the premium plans, or can I do this with a basic account?
christyprice Posted June 15, 2021 Posted June 15, 2021 @AndrewFreedman you can workaround using Custom CSS instead of code injection using the steps in the blog post I linked to above. You'll just need to target the collectionID. christyprice.com 🇺🇸 Austin, TX US 🐾 ✅ Get my Starter Template for Web Designers 🎬 Watch 7 Ways to Save Time as a Squarespace Designer from Circle Day 2024 🎥 Watch Circle Live: Hello Income (feat. Christy Price and Jeremy Schwartz)
AndrewFreedman Posted June 17, 2021 Author Posted June 17, 2021 @christyprice So I tried doing the code below but I can't figure out how to stop getting a Syntax error /* 404Page */ #collection-60c04a57ab55910fd8381492 { <style> .header-nav {display: none!important; } .header-burger {display: none!important; } </style>} Would you know how I should change the code so it works and its just my header without the nav?
creedon Posted June 18, 2021 Posted June 18, 2021 @AndrewFreedman Try the following. <style> /* 404Page */ #collection-60c04a57ab55910fd8381492 .header-burger, #collection-60c04a57ab55910fd8381492 .header-nav { display : none !important; } </style> Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
AndrewFreedman Posted June 18, 2021 Author Posted June 18, 2021 Hi @creedon unfortunately that also gives me a syntax error when I copy and paste it into my custom CSS
creedon Posted June 19, 2021 Posted June 19, 2021 @AndrewFreedman Since the code you posted had a style tag in it I assumed the CSS was for another place other than Custom CSS. To make the code work there just remove the first and last line. <style> and </style>. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
AndrewFreedman Posted June 20, 2021 Author Posted June 20, 2021 @creedon When I do that I get an error that one of the opening or closing brackets is missing but I can't seem to figure out which one. Would you mind just pasting the code I need please?
creedon Posted June 20, 2021 Posted June 20, 2021 /* 404Page */ #collection-60c04a57ab55910fd8381492 .header-burger, #collection-60c04a57ab55910fd8381492 .header-nav { display : none !important; } Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.