GregLassale Posted April 8, 2021 Posted April 8, 2021 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!
creedon Posted April 9, 2021 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.
GregLassale Posted April 9, 2021 Author 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!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.