Using Code and HTML in Image Titles on Squarespace
Back in September of 2018, Squarespace decided to no longer allow code / HTML in image titles. Here's a fix to give you back that functionality. Simply enter this code into SETTINGS > ADVANCED > CODE INJECTION.
If you have AJAX LOADING on your website, disable that first by going to DESIGN > SITE STYLES and unchecking the option for AJAX LOADING (only some of the newer templates have this option so if you're using an older template, you can ignore this step).
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <script> $(function(){ $(".image-slide-title").each(function(){ $(this).html($(this).text()); }); }); </script>
P.S. You may have to change ".image-slide-title" depending on how you're using titles.
By using the above code, you can easily add a new line to image titles, or have multiple lines of text for image titles in Squarespace. To add a new line, just use <br/> in your image title. So something like “First Line<br/>Second Line”.