Jump to content

[Share] Exclude a category of posts from showing on the main blog page

Recommended Posts

If code doesn't work, you can send blog page url + exact code you added, I will check again.

You can follow these steps to exclude a category of posts from showing on the main blog page.

#0. Suppose you have a blog category: Bike, you want to hide all posts belong this category on main blog page.

#1. Edit all posts belong the category: Bike

image.thumb.png.76d35a84b3cfc864f5caeae5a0f90b42.png

#2. Edit Excerpt > Enter text: bike

image.png.9a5a1573a3c5bcde459189c391d3335b.png

Highlight it and add URL: #bike

image.png.eb2c83c45eb2d9dd4047c617e70eb4be.png

#3. Find Main Blog Page ID. Use below tool.

In my example, it is:

#collection-6677756d03a4f15ba27ce9d8

image.png.ee3e3938af657f8d54c5c694510c3a99.png

#4. Use this code to Custom CSS box

#collection-6677756d03a4f15ba27ce9d8 {
  article.blog-item [href="#bike"] {
      display: none;
  }
  article.blog-item:has([href="#bike"]) {
      display: none;
  }
}

image.png.0f9c1b1b858b4a78fb6ce78c7e0a9aa5.png

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
  • Replies 0
  • Views 178
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.