Jump to content

Adding Subtitles to Blog Posts

Recommended Posts

  • Replies 1
  • Views 472
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

First, edit your title to this format

 Re-Examining How the Church Defines # Discipleships
    

Next, add this to Code Injection > Footer

<!-- Code from sf.digital, tweaked a bit with class name -->
<script>
  window.Squarespace.onInitialize(Y, () => {
  var title = document.querySelectorAll('h1 a');
  for (var sf = 0; sf < title.length; ++sf) {
    var item = title[sf]; 
    item.innerHTML = item.innerText.replace(/#/g, '<br>');
  }
});  
</script>

 

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.