Created
October 10, 2016 17:03
-
-
Save dattard21/84cca7719661e8c603d03370f82ab852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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