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! 

Link to comment
  • Replies 3
  • Views 404
  • Created
  • Last Reply

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.