DavidCliff Posted June 19 Posted June 19 (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 June 19 by DavidCliff tuanphan 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment