Jump to content

Hide a menu from the blog category page

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://dave.online/writings

I have a site I blog on with three primary categories. I built a little menu at the top of the page that will display the blogs within a specific category, and I want that displaying on the /writings page. But when someone clicks it and goes to say, /writings/category/travel I want just the blogs to show without this menu.

Any help would be amazing. Thank you!

Link to comment
  • Replies 6
  • Views 358
  • Created
  • Last Reply

Top Posters In This Topic

15 hours ago, tuanphan said:

Hide Menu, or Hide header (logo, menu, button) or hide both header + header banner?

I want to hide this menu I made on the page that sorts by categories. When someone clicks a category, I want just the blogs to load without this menu at the top. Thanks so much!

Screen Shot 2022-10-08 at 5.47.23 PM.png

Link to comment
On 10/9/2022 at 7:48 AM, daveneedshelp said:

I want to hide this menu I made on the page that sorts by categories. When someone clicks a category, I want just the blogs to load without this menu at the top. Thanks so much!

Screen Shot 2022-10-08 at 5.47.23 PM.png

You mean hide red circle slide on screenshot??

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • Solution
On 10/11/2022 at 8:54 AM, daveneedshelp said:

Yep, thanks!

Add to Settings > Advanced > Code Injection > Footer

<script>
  if (document.location.pathname.indexOf("/writings/category/") == 0) {
    document.querySelector('body').classList.add('t-category')
}
</script>
<style>
  body.t-category .user-items-list-item-container[data-section-id="633f26654feea6653e15003b"] {
    display: none;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...
On 10/12/2022 at 5:39 AM, tuanphan said:

Add to Settings > Advanced > Code Injection > Footer

<script>
  if (document.location.pathname.indexOf("/writings/category/") == 0) {
    document.querySelector('body').classList.add('t-category')
}
</script>
<style>
  body.t-category .user-items-list-item-container[data-section-id="633f26654feea6653e15003b"] {
    display: none;
}
</style>

 

That is perfect. Thank you so much! 

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.