Skip to content

Instantly share code, notes, and snippets.

@dattard21
Created October 10, 2016 17:03
Show Gist options
  • Save dattard21/84cca7719661e8c603d03370f82ab852 to your computer and use it in GitHub Desktop.
Save dattard21/84cca7719661e8c603d03370f82ab852 to your computer and use it in GitHub Desktop.
add_filter( ‘title_save_pre’, ‘add_sitename_to_title’, 10, 2 );
add_sitename_to_title( $title, $sep ) {
// You might want to check whether the title has been added already before appending the title (again)
/* Retrieve site name. */
$name = get_bloginfo( ‘name’ );
/* Append site name to $title. */
$title .= $sep . ‘ ‘ . $name;
/* Return the title. */
return $title;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment