Jump to content

How do I hide Page Header in my Blog Category?

Recommended Posts

Site URL: https://jamesaltonvisuals.com/

Hi there,

I am trying to hide my page header on everything but my homepage. I've done this so far to make it work,

.page-header
{
  display: none;
}

#collection-5e9ced4eaae6d36c0e265c79 .page-header,
.homepage .page-header
{
  display: block;
}

But because my homepage is also my portfolio blog, I want to hide it when I select my categories such as 'Commercial'.

Is this possible? Or do I have an odd/non-standard setup here?

I find it frustrating that blog categories are hard links in the menu and therefore are treated as separate pages in the menu but they're also viewed as the homepage at the same time. It's very confusing!

Thank you!

James Alton Visuals 2020-12-03 at 19.27.51 PM.png

James Alton Visuals 2020-12-03 at 19.28.19 PM.png

Link to comment
  • Replies 1
  • Views 202
  • Created
  • Last Reply

You may need to take advantage of javascript

<style>
	.page-header {
      display: none;
    }
</style>
<script>
  window.Squarespace.onInitialize(Y, function() {
      if ( window.location.pathname == '/' ){
          document.querySelector(".page-header").style.display = "block";
      }
  });
</script>

into Advance->Code Injection->Header

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

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.