Jump to content

Hide Specific Category Filter from Products/Shop Feed

Go to solution Solved by tuanphan,

Recommended Posts

  • Replies 7
  • Views 425
  • Created
  • Last Reply

Top Posters In This Topic

Hi Katie,
You can hide it with CSS. Try inserting this CSS code in the Page Header Code Injection.

<style>
/*Hide Free Resources*/
.products.collection-content-wrapper .nested-category-breadcrumb-list-item:nth-child(2){
   display: none !important;
}
</style>




Warning: This CSS code is using  nth-child(2) which since 'Free Resources' is the 2nd option in the category list so if you're adding more categories in the future, make sure to update nth-child(2) to the new order of 'Free Resources' in the category list example: nth-child(4). 

We offer solutions for filtering, multi-location map display, adding tables, raising summary block limit and more at Squarewebsites  🔳.

Link to comment
On 6/19/2024 at 11:49 PM, katiependergast said:

Hey! Thank you so much for the code. Unfortunately, it didn't seem to do anything on the site. I also tried putting it in Custom CSS from the dashboard and it didn't work there either.

Remove Category on Left only or Remove Category on Left + Remove products belong that Category?

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 6/22/2024 at 12:34 AM, katiependergast said:

Remove category on left and remove products that belong that category, please!

Try this code to Website Tools (under Not Linked) > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function(){
    $('html:has(link[rel="canonical"][href="https://www.miclovesme.com/shop"]) .product-price:contains("$0.00")').addClass('hide-free');
});
</script>
<style>
  div.grid-item:has(.hide-free) {
    display: none !important;
}
  li.category-item:has([href="/shop/free-resources"]) {
    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

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.