Top

How to Add a Subtitle to WordPress Post and Page Titles

June 1, 2011

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:

<?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:

<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.

Because this plugin/widget is provided free of charge, I simply ask you to link back to Pressography.com in a post on your blog, or from one of your sites. It doesn't need to be anything fancy - just a note saying that you're using it, and whether or not you like it. However, there is no requirement that you do this, you're free to use the plugin regardless.

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.