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

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

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

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.