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:

<span class="entry-subtitle">Your snappy subtitle</span>

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 Comments


      1. Great stuff :) Thanks Philip! Now our blog posts will look so much better

        Report


  1. I’ve been running something similar on my own blog for a quite a while. I basically use the same method, except with a lot less code. It’s nice to see someone wrap this up in a plugin for others to use though.

    Report


    1. Justin, could you opensource your approach? Perhaps Philip would improve his plugin = everybody wins ;)

      Report


      1. The plugins do the same thing. His is just better for being a public plugin since the code is more rounded out. I’ll look more into it and shoot any GitHub tickets his way though if I see anything that’s different between the two.

        Report


    1. Jim Walker – It was just approved for the repo – not an important point left out ;)

      Report


  2. @Jim, the plugin sees to have multiple CSS and JS files, will it impact loading time? Also, the CSS class for subtitle seems to be “entry-subtitle”, wouldn’t an h2 class suit better?

    Report


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

      Report


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

      Report


      1. Hey Philip! Is there anyway to integrate this with Noah Kagan’s Headlines (by KingSumo, the sister company of AppSumo)? I find that it generates a second subtitle on the archive, based on the WooThemes’ SuperStore theme.

        If yes, it’ll be amazing, because Headlines’ is indeed an amazing idea :)

        Report


      2. If you open an issue on GitHub and explain to me exactly the steps that I can take to reproduce your error then I’ll be happy to either add integration directly into the plugin or tell you how to fix it on your own. I don’t have access to the theme that you’re referring to, but my hunch is that this may boil down to a very simple solution. We can discuss it directly on GitHub. Thanks.

        Report


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

    Report


  4. Sarah – Thanks for posting this! Philip – Thanks for providing us this much-needed functionality in a plugin! You just made my day – this is just what I’m looking for.

    Report


  5. It also works great in ElegantThemes’ Divi, which quite doesn’t play well with some plugins. Nice post and nice plugin!

    Report

Comments are closed.