How to split up the_title and insert a span tag

its best if you just use custom field type to create a sub title…
That way you leave the title un-touched and just add a field where
you can insert a value like so (calling field sub title):

enter image description here


Then you can fetch your subtitle easily:

<?php
$sub_title=get_post_meta($post->ID,'subtitle',true);
if($sub_title != '') {
echo '<h1>'. the_title() .'<span>'. $sub_title .'</span></h1>';
} else {
echo '<h1>'. the_title() .'</h1>';
}
?>

.
i hope this a suitable solution for you… i use it on occasions

Cheers, Sagive


HOW TO:

Replace (i hope it looks the same in your theme) with the code above..:

<h1><?php the_title(); ?></h1>

Leave a Comment