Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
ablaze1570047688

Five: Hide blog header content on posts?

Question

I want to use the built-in Blog Header Content block for a blog-specific header when viewing the full blog feed, but I don’t want it to show up when viewing an individual post. Does anybody know how to hide it on posts only?

Edited by Jeng
retag

Share this post


Link to post

11 answers to this question

Recommended Posts

  • 1

I found this code works in a way.


<style> #page-body-header {display:none} </style>

If you insert it on your blog page header code injection it will remove the header block. Unfortunately it removes it for both the index and posts.I'm not sure how to get it to only work in posts and leave the index alone.

Edited by Carlos Anon

Share this post


Link to post
  • 0

Hazaar! I just worked it out.

In your blog post right at the top (might work anywhere but this is where it worked for me) add a code block. Leave the display source setting as HTML and make sure it is unchecked.

then clear the default message and enter the following code:


<style> #page-body-header {display:none} </style>

Then save the block and voila! Your blog page header content block will disappear from the blog post.

Share this post


Link to post
  • 0

I haven’t tested this yet, but it’s good to know there’s a workaround out there. However, this isn’t a workable solution for me. For one thing, remembering to put this block into every post is just definitely not gonna happen. More importantly, though, I don’t want to be loading my posts with styles that might mess things up if I ever leave Squarespace. I want my blog posts to be totally valid and future-proof.

Share this post


Link to post
  • 0

@Carlos Anon and @ablaze rather than use a code block like this on every post (yuk) just use the code in my answer instead. It'll save you a lot of trouble.

Edited by eanderson

Template Developer at Squarespace, @esquareda on Twitter.

Share this post


Link to post
Guest
This topic is now closed to further replies.

×
×
  • Create New...