Jump to content

Help with CSS override code!

Recommended Posts

Posted

Site URL: https://corn-apricot-zn88.squarespace.com/portfolio

This is from a FB page, but I still need help: I am not sure how to do what the respondent suggests - I have tried a ton of options to use the selector and override to show all the summaries under that filter. 

 

I have a tough one: Someone HERE helped me with a code to limit the number of posts showing in a blog summary:
#block-206175b0d9ba3902e4c7 {.summary-item-list .summary-item:nth-child(n+28) {display: none!important;}}
BUT, I am using the Universal Filter and now it limits the number with anything filtered. I have the filter set so you can only choose one item at a time, so I am hoping there is a way to tell it to increase the number of summaries visible (n+36) during the Pre-K-12 filter.
I tried something like .project-types-pre-k-12 {.summary-item-list .summary-item:nth-child(n+30) {display: none!important;}} BUT no luck.
HELP!!! 🙂
 
  • Jay Van Dyke
    This is most likely the selector [data-filter-selectors=".project-types-pre-k-12"] instead of writing as a class like you have. You also might have to write a rule to override and show the two that are being hidden by the other rule. It is a class but only on the individual items not the list as a while like you have this written. Have you written to Michael on slack? Maybe there's something in the code to achieve what you want without using CSS.
     
    •  
    •  
       
       
      Jay Van Dyke I contacted him a couple months ago about limiting the posts for the splash page. His solution was to filter them out using an “init state” filter, but that ended up breaking something else (I don’t recall what).
      I was really hoping the block number would change with each filter, but that doesn’t happen.
      It is definitely the “data filter selectors.” I will see what I can do to override the N +28. Any thoughts if it is best to try it in CSS? Or to add a code block in the page?
       
Posted
On 1/1/2022 at 12:26 AM, tuanphan said:

Don't remove/edit any code

Add this to SETTINGS > ADvanced > Code Injection > Header

<style>
  .summary-v2-block.using-simple-filter .summary-item-list .summary-item {
    display: block !important;
}
</style>

 

Hi @tuanphan It doesn't work. If I remove the !important from the 

#block-206175b0d9ba3902e4c7 {.summary-item-list .summary-item:nth-child(n+28) {display: none!important;}}

then it shows all the items on the front page. If I keep the !important, then it only show up to 28 on the filtered page. 

 

There has to be a way to override it 🙂

 

Posted
11 hours ago, deaton72 said:

Hi @tuanphan It doesn't work. If I remove the !important from the 

#block-206175b0d9ba3902e4c7 {.summary-item-list .summary-item:nth-child(n+28) {display: none!important;}}

then it shows all the items on the front page. If I keep the !important, then it only show up to 28 on the filtered page. 

 

There has to be a way to override it 🙂

 

Did you add to Custom CSS or Code Injection Header?

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!)

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.