Jump to content

General coding question - index page vs sub pages

Recommended Posts

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 by GregLassale
Link to comment

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 best , and see my profile. Thanks for your support!

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.