Jump to content

How to add custom copy to individual category pages

Go to solution Solved by tuanphan,

Recommended Posts

Hi, I'm working with a client https://www.veganfairs.co.uk/ and they would like to add unique content to the top of each category page.

For example https://www.veganfairs.co.uk/upcoming-events?category=Frome will have its own content at the top of the page and https://www.veganfairs.co.uk/upcoming-events?category=Devizes will have its own unique content also.

Is there a way to do this with custom css? When I'm adding it currently via the builder, it changes across all categories and the /upcoming-events page too. 

I've seen similar threads on this but nothing has helped so far.

Thanks!

Link to comment
  • Replies 3
  • Views 347
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
  • 5 weeks later...
  • Solution

2 options to do this

Option 1. Create a new page, use Summary Block to pull events from Event Page, then you can add any text block above event

Option 2. Use Script code, each page will need a different code, with this page https://www.veganfairs.co.uk/upcoming-events?category=Devizes

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script src="https://d1j8mu9lowy9zf.cloudfront.net/twcsl/0.1d19/twcsl.js"></script>

<script>
  var url = window.location.href;
var lastPart = url.substr(url.lastIndexOf('/') + 1);

if (lastPart === "category=Devizes") {
   document.querySelector('body').classList.add('devizes')
}
  </script>
<style>
  .devizes .sqs-events-collection-list:before {
    content: "enter description what you want";
    display: block;
    margin-bottom: 30px;
}
</style>

image.thumb.png.887da6ddeb97e72263e85f2271e95376.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

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.