Friday, April 27, 2012

How to add 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.

No comments: