GregLassale Posted April 8, 2021 Share Posted April 8, 2021 (edited) Does code injected to an index page header affect all its subpages? More concretely, my site is bilingual and I have code that hides the secondary (language 2) navigation bar items when visiting the language 1 version, and vice versa: <style> nav.Header-nav--secondary { display: none; } .Mobile-overlay-nav--secondary { display: none; } </style> and <style> nav.Header-nav--primary { display: none; } .Mobile-overlay-nav--primary { display: none; } </style> Right now, I have that code in both index pages' headers but also injected locally to every single supbpage. Can it be removed from the subpages as long as it stays in the index pages? Thanks! Edited April 8, 2021 by GregLassale Link to comment
creedon Posted April 9, 2021 Share Posted April 9, 2021 Index pages ignore subpages Advanced > Page Header Code Injection. So as long as the index subpages will not be viewed on their own then you can get rid of Page Header Code Injection code for subpages. Although just as a safety precaution you may want to squirrel away the code in case you need it later! 🙂 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. Link to comment
GregLassale Posted April 9, 2021 Author Share Posted April 9, 2021 Mine is a long scroll single page website and subpages are not meant to be viewed indvidually., so I think I'm good there. I do save all my current and old bits of code in text files just in case, though. Thanks! creedon 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