clever carrot website design
  • Home
  • Portfolio
    • Deadbeat Darling
    • NBA Gauntlet
    • Citadel
    • Precise CPA
    • Chance Favors
    • Free Love Forum
    • Cleantech Advisors
  • Blog
    • Archives
  • About
  • Contact

How to Add Subtitles to WordPress

Just copy and paste the code!
In just 3 easy steps you can have attractive subtitles on your WordPress site.
  1. Go to the edit screen for the post or page where you want subtitles.
  2. Under the Custom Fields heading, enter a new custom field name. Type subtitle in the Name field. Type the subtitle text in the Value field. Add the custom field.
  3. Add the below code in your post or page template after the title code (or wherever you want it to appear) and save.
< ?php
{ $subtitle = get_post_meta
($post->ID, 'subtitle', $single = true);
if($subtitle !== '') echo $subtitle;} ?>

Voila!

Share/Save

rss Subscribe for more web design tips!
Post a comment or leave a trackback: Trackback URL.

18 Responses

  1. Anthony says:
    March 16, 2009 at 6:14 pm

    Hey thanks for the post, I think there is an error with the { and the } in the code, once I remove those it works like a charm. I haven’t updated to the latest wordpress yet so it might just be for the older version.

    ID, ‘subtitle’, $single = true);if($subtitle !== ”) echo $subtitle; ?>

    Thanks again :)

    Reply

    Harris Reply:
    March 16th, 2009 at 7:06 pm

    That’s odd that there would be an error. For PHP expressions, { is always the beginning and } is the end. Could you email me the code you used? I don’t see it on your site.

    Reply

    Mathias Vagni Reply:
    July 16th, 2010 at 2:39 pm

    I think what is making it not work for you is the space between the first “<” and “?php”. Delete the space.

    Reply

  2. Mr. Blue says:
    May 2, 2009 at 5:21 am

    Hi,

    thanks for the tip. However, how do I get the subtitles showing under the title under the next and previous post links when viewing only one post?

    Reply

  3. Simone says:
    November 7, 2009 at 8:31 pm

    How would I go about adding a subtitle to my Page title, so that it in the menu the Page title displays and underneath the subtitle displays?

    Reply

  4. Gaëlle says:
    December 10, 2009 at 6:29 pm

    Tx ! We don’t need any plugin.
    It was just the snippet I was searching for. Custom fields are fantastic.

    Reply

  5. Joel says:
    April 6, 2010 at 2:23 am

    Great tip. I just wish you attached screenshots to the article. It’s difficult to imagine how these subtitles look like when coupled with WordPress blog titles if you’ve been seeing just titles since the blogging platform was launched.

    Reply

  6. Joel says:
    April 6, 2010 at 2:27 am

    Oh, duh! My bad. There they are. Can the subtitles appear just below the title on the main page, before the jump? It looks out of place when it’s below the date, appearing more like a blurb than a subtitle.

    Reply

  7. Quanah Zimmerman » Blog Archive » Adding subtitles to Wordpress.Quanah Zimmerman says:
    July 11, 2010 at 4:12 am

    […] was looking to add subtitles to my posts. I found the answer over at Clever Carrot: In your WordPress editor simply add « subtitle » in the custom name field […]

  8. c says:
    September 19, 2010 at 9:25 pm

    Does anyone know of a good WordPress course that really teaches this stuff I need one bad thanks.

    email me at cman7@inbox.com.

    Reply

  9. Eddie Renz says:
    November 26, 2010 at 11:35 pm

    OMG. This is exactly what I needed. I was using a plugin that was totally crapping out… but this works flawlessly!

    Reply

  10. Jad says:
    February 11, 2011 at 10:41 am

    Worked like a charm! Thanks so much!

    Reply

  11. Mike says:
    May 3, 2011 at 10:58 pm

    This is great. I’m a total newbie, and following your instructions managed to get the value to appear in the right place, but I’m now trying to figure out how to define the style for my subtitles. Do I need to add the field to my style sheet? I’m sure it’s a stupid question, but any chance you could help? Thanks.

    Reply

  12. JT says:
    May 6, 2011 at 7:37 pm

    Great little post!
    I’ve not only managed to easily put subtitles on my site, but also I’ve instantly learnt what custom fields are and how they work!
    A whole new world to explore… thank you!

    Reply

  13. Cathy says:
    June 13, 2011 at 11:29 am

    THIS IS SUPER HELPFUL! thanks a lot!

    Reply

  14. Joseph says:
    June 15, 2011 at 7:48 am

    I can’t find a menu item called “Custom Fields” :(

    Reply

    Harris Reply:
    June 15th, 2011 at 8:10 am

    You might have to click on Screen Options in the top right of the Posts screen and check off Custom Fields so they appear.

    Reply

  15. Joseph says:
    June 15, 2011 at 8:34 am

    I found Custom Fields…The code doesn’t work at all, for me (it just appears as code on my blog pages, so I have had to remove it…I’ve tried it with and without the { } and I’ve also tried it with < ?php and with <?php — all to no avail…

    Reply

Leave a Reply

Click here to cancel reply.

Click to cancel reply
« Spicier New Slim Jim Logo
Ovaltine Cleans Its Can »

Search Archives

Categories

  • Internet
  • Logos
  • WordPress

Recent Posts

  • How to Choose a Web Host
    0 Comments
  • Ovaltine Cleans Its Can
    3 Comments
  • How to Add Subtitles to WordPress
    18 Comments
  • Spicier New Slim Jim Logo
    2 Comments
  • Ingredients of a Bad Website
    0 Comments
  • Pages

    • About
    • Blog
      • Archives
    • Contact
    • Home
    • Portfolio
      • Chance Favors
      • Citadel
      • Cleantech Advisors
      • Deadbeat Darling
      • Free Love Forum
      • NBA Gauntlet
      • Precise CPA
  • Categories

    • Internet
    • Logos
    • WordPress
  • Archives

    • August 2010
    • April 2009
    • February 2009
    • July 2008
    • April 2008
  • Blogroll

    • Precise CPA Services
  • RSS Feeds

    • All posts
    • All comments
  • Meta

    • Log in
contact us with questions
Clever Carrot specializes in web design, search engine optimization, computer consulting, and marketing solutions for small businesses in the New York City area.
© 2010 Clever Carrot. All Rights Reserved. Only the freshest ingredients. Valid XHTML.