Thursday, October 28, 2010

Display title of parent & sub page

global $post;
if($post->post_parent)
{
$parent_title = get_the_title($post->post_parent);
echo $parent_title;
}
else 
{
wp_title('');
}

No comments:

Post a Comment