You can adjust the var characterCount to a different number to adjust how much it cuts off. You can also adjust the "trail".
This code will also only cut full words, that way it doesn't cut it at weird points. i.e. "Learn more about Squaresp...."
<script>(function(){
window.addEventListener('load',function(){var characterCount =140var blogParagraph = document.querySelectorAll('.BlogList-item-excerpt p')var trail ="..."// Shorten a string to less than maxLen characters without truncating words.function shorten(str, maxLen, separator =' '){if(str.length <= maxLen)return str;return str.substr(0, str.lastIndexOf(separator, maxLen));}
blogParagraph.forEach(item =>{
item.textContent = shorten(item.textContent, characterCount)+ trail;})})})()</script>
I tried this with my site but it didn't work. It's using v7.1, but for some reason Squarespace doesn't want me to know which template I chose, and I can't remember. I can't find the disable Ajax control in site styles either. The url is wilsonwillis.squarespace.com – but the blog pages are disabled for now as they are not ready for public view. Should this script still work for me? Sorry I may not have given enough information for this query...
UPDATE: I realised that I wanted a script to apply to a summary block, not a blog post page. So the scripts here didn't work. I found a script here that did...
Custom CSS To Limit Blog Excerpt
in Customize with code
Posted · Edited by simon_clarke
I tried this with my site but it didn't work. It's using v7.1, but for some reason Squarespace doesn't want me to know which template I chose, and I can't remember. I can't find the disable Ajax control in site styles either. The url is wilsonwillis.squarespace.com – but the blog pages are disabled for now as they are not ready for public view. Should this script still work for me? Sorry I may not have given enough information for this query...
UPDATE: I realised that I wanted a script to apply to a summary block, not a blog post page. So the scripts here didn't work. I found a script here that did...
https://nestingzone.com/design-blog/how-limit-blog-post-excerpt-word-count