Skip to content

Instantly share code, notes, and snippets.

@drewyeaton
Created December 7, 2009 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewyeaton/250866 to your computer and use it in GitHub Desktop.
Save drewyeaton/250866 to your computer and use it in GitHub Desktop.
<title>
<?php
$sep = ’ | ‘;
$site = get_bloginfo(‘name’);
if(get_post_meta($post->ID, ‘title’, TRUE)) {
$title = get_post_meta($post->ID, ‘title’, TRUE);
} else {
// we need this because page title isn’t shown when on homepage
if(is_front_page() || is_home())
$title = get_bloginfo(‘description’);
else
$title = wp_title(”, FALSE, ‘right’);
}
echo($title.$sep.$site);
?>
</title>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment