How to Create Replacement Page Titles in WordPress
Here’s a quick tutorial showing how to replace your Page titles in WordPress with custom values different to those shown in your site’s navigation. Sorry about the poor sound quality — I wasn’t speaking from inside a cave, I just had the wrong levels set for my microphone!
In case you can’t make out the code that’s being written in the screencast, you can copy and paste from below…
In header.php, replace your <title> tag with this:
<?php $rpt = get_post_meta($post->ID, 'Replacement_Page_Title', true); ?>
<title>
<?php if ($rpt) { echo $rpt . " « "; }
else { wp_title('«', true, 'right'); }; ?> <?php bloginfo('name'); ?></title>
In page.php, replace your Page Title code with this:
<?php $rpt = get_post_meta($post->ID, 'Replacement_Page_Title', true); ?>
<h2><?php if ($rpt) { echo $rpt; } else { the_title(); }; ?></h2>
1 Comment
Comments have been closed for this post.
This entry is filed under tutorial, wordpress and tagged with custom fields, Rob Barrett, Rob-Barrett.com.
You can also follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.

this is good, l like it bec very clear and easy to follow