New Plugin Adds Subtitles to WordPress Posts, Pages and Custom Post Types

subtitle-example

In the past, adding subtitles to WordPress posts always required something a little hacky. Sometimes theme authors would hijack post excerpts or use custom fields in order to accomplish it, but these methods made process of adding a subtitle confusing for users.

Subtitles is a new free plugin created by WordPress developer Philip Arthur Moore. It lets you easily add subtitles to WordPress content, including posts, pages, and even custom post types.

Although there are several subtitle plugins already available on WordPress.org, the best feature about this one is that you don’t have to add any template tags to your theme in order to display subtitles. The Subtitles plugin just works – no theme tweaks or coding required.

Once installed you’ll find a new place in the WordPress editor for adding subtitles:

subtitles-with-bacon

After you add a subtitle to a post and save it, you’ll see it added to the frontend. Here’s one example using the Fictive theme. However, it really doesn’t matter what theme you’re using; the plugin will automatically output your subtitles in a matching style.

subtitles-frontend

Customizing Subtitles

Subtitles will show up in singular, post archives, search results, and can be further extended to display in other views, such as widgets. The markup outputted for them is a span with a specific class you can use to customize their display:

[html light=”true”]<span class="entry-subtitle">Your snappy subtitle</span>[/html]

This makes it super easy for theme developers to add support for subtitles. If you already have subtitles built into your theme, you can make it leaner by cutting out the hacky methods and adding support for the Subtitles plugin instead.

You’re also not locked into the markup it generates. The markup can be changed by hooking a custom output function to subtitle_markup. An example is shown in the plugin’s documentation.

Subtitles are stored in post meta in your database. If you deactivate the plugin or uninstall it, your database will still keep these entries in case you ever decide to use the plugin again. Moore is considering adding an option to a future release of the plugin that would allow you to clean the subtitles post meta from your database.

Subtitles is currently the most well-documented, extensible plugin available for adding subtitles to your WordPress site. It’s available for download on WordPress.org and you can also find it on GiHub.

23

23 responses to “New Plugin Adds Subtitles to WordPress Posts, Pages and Custom Post Types”

    • H2s are not suitable for subtitles. Please read the documentation for why:


      * 5. The reason that are being used is because HTML does not have a dedicated mechanism for
      * marking up subheadings, alternative titles, or taglines. There are suggested alternatives from
      * the World Wide Web Consortium (W3C); among them are spans, which work well for what we're trying
      * to do with titles in WordPress. See the linked documentation for more information.

      See the W3C for more information.

      If you’re concerned about the markup of the output, you can also filter it to your liking.

      There is only one CSS file output to the front end of the site. The other files are for the back end of your site. There’s one CSS file to style the input, one JS file to manage the input interactions, and one CSS file for a sensible style default for your subtitles.

      Any additional concerns you may have I’ll be happy to answer on GitHub or on WordPress.org.

    • Rahul, one more thing. Please feel free to read through the inline developer documentation to understand more about the design decisions in this plugin: https://github.com/philiparthurmoore/Subtitles/blob/master/subtitles.php.

      In short, no, SEO shouldn’t suffer. Yes, you can totally change the output of how subtitles appear on your site. 1 CSS gets loaded to your site – I could certainly see a case for inlining this styling to avoid the extra server request and will consider it in a later version. The other 2 resources (1 CSS and 1 JS file) are needed for sensible usability in the back end.

      Cheers.

  1. A very nice plugin – should be part of Core. It works on my Themify theme. Thank you Philip and Sarah!

    One recommendation would be the capability of populating all Post subtitles with existing excerpts. All of my excerpts play off of the Post titles.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.