How to Add a Subtitle to WordPress Post and Page Titles

Subtitles can be quite handy for revealing more content to your reader for a better explanation of your post. Adding a subtitle to your WordPress posts seems like a small thing, but when you find out that it’s not built in, you’ll have to come up with a quick solution for site.

Of course you could always create a new custom field for subtitles and then add something like this to post loop after the title:

1
2
3
4
<?php
{ $subtitle = get_post_meta
($post->ID, 'subtitle', $single = true); 
if($subtitle !== '') echo $subtitle;} ?>

However, if you’re not comfortable modifying files, then you’ll want to install a plugin. Up until today there were several plugins out there for subtitles, none of which had been updated recently.

Visual Subtitle is a new plugin that handles the creation of subtitles in an entirely visual way, as opposed to keeping it as a separate entity. Here’s how it works: It allows you to include a string of text that will still be part of the post title, except it’s wrapped in a span tag, like this:

1
<h1>This is the title<span class="subtitle">This is the wrapped "subtitle"</span></h1>

The subtitle is separated with a pipe (|) character in the post screen and appended to the title part of the document title with a colon (:) character.

This gives you the freedom to style the subtitle with your theme and make it appear to be separate from the main title. Make sure to add .subtitle { display: block; } to your CSS plus any other style you want to apply to the subtitle.

The end result gives you something similar to the screenshot above. You’ll even be able to view your subtitle in the post management and quick edit screens:

The Visual Subtitle plugin is available for free from the WordPress plugin repository. Download it and start adding some styles to get fancy post titles in under five minutes.