Jump to content

Solved: Fix for Missing Blog Category Title on Squarespace Filtered Pages

Recommended Posts

Posted (edited)

If you’re experiencing an issue where Squarespace doesn’t print the blog category title on the filtered page for that category, you can use this simple JavaScript fix. The category title is usually contained in the meta title tag, and we can extract and display it on the page using the following steps:

Add this code to a HTML block at the top of the page:

    <div id="title-content"></div>
    <script>
        let pageTitle = document.querySelector('title').textContent;
        pageTitle = pageTitle.replace('YOUR-SITE-TITLE', '').trim();
        pageTitle = pageTitle.split('—')[0].trim();
        document.getElementById('title-content').textContent = pageTitle;
    </script>

Be sure to change YOUR-SITE-TITE to your site title 👍🏼

Style using custom CSS.

Edited by DavidCliff
  • DavidCliff changed the title to Solved: Fix for Missing Blog Category Title on Squarespace Filtered Pages

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.