Jump to content

Add Subtitle Below Blog Post Title

Go to solution Solved by tuanphan,

Recommended Posts

Hi there. I'd like to add a subtitle to my blog posts, much in the same way that Substack has an automatic subtitle field below each article title. This would be different from the Excerpt.

If anyone has a way to do this CSS, please let me know.

Link to comment
  • Replies 5
  • Views 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

On 5/3/2024 at 2:22 AM, JN2024 said:

Hi there. I'd like to add a subtitle to my blog posts, much in the same way that Substack has an automatic subtitle field below each article title. This would be different from the Excerpt.

If anyone has a way to do this CSS, please let me know.

Do you want like this?

Screenshot_186.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
  • Solution

You can follow this. 

#1. First, use this code to Code Injection > Footer (or Blog Page Header Code Injection)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $(".blog-item-title h1, h1.blog-title").each(function(){
    $(this).html($(this).text());
  });
});
</script>

image.png.f8008c1ffab1eda04b8203e09266dfdf.png

#2. Edit Blog Post Title, use em tag, something like this

Blog Post Title 03 <em>Trekking</em>

image.thumb.png.497a79b8fe123e25b007c744f26c7534.png

#3. Use this code to Custom CSS box to style Subtitle

h1.blog-title em, .blog-item-title em {
    font-style: normal;
    display: block;
    font-size: 26px;
    color: #f1f;
}

image.png.adefff4a027dc089d04fceb7fdce8972.png

#4. Result

image.thumb.png.c7b0cf3c04029c1db01055373759224b.png

image.png.174179dc913022ad3f8793c4c88462cd.png

#5. When you use <em> tag, it will appears on Browser Tab Name, so you can edit SEO Title to fix it.

image.thumb.png.17f05d8c4fb7d6c95c6210e09b8bef69.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
  • 4 months later...
On 9/9/2024 at 11:04 PM, abbiericher said:

Hi @tuanphan,

Thanks for the code! I just used it on a client's website. One question though, how can I removed the em tag on the previous/next pagination?

website: https://fbq-conception.squarespace.com/
password: freelance

Can you share link to a blog post? We can use script code to remove it

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.