Adding subtitle to your wordpress post

Adding subtitle to your wordpress post

For adding post subtitle simple place the below code in your theme template or wherever you like.

<?php
{ $subtitle = get_post_meta
($post->ID, 'subtitle', $single = true);

if($subtitle !== '') echo $subtitle;} ?>

After this you have to go to your post then create a custom field named “subtitle” and put the value that you want as a subtitle. To see the custom field you have to enable it from screen option from wordpress backend.

That’s all. It’s simple.

Join the Conversation

2 Comments

  1. Hi, thanks for your tutorial, i added the code in several places and i did not got it to work, the Subtitle does not places itself under the title on neither of the cases, can you please specify where should i put it?

  2. Thanks for reading this post and visiting my site. Actually You have to add it to the custom post loop and then have to set the value from each post.

    That’s it

Leave a comment