Created
May 11, 2015 11:28
-
-
Save reasonstousegenesis/91a322092bb3a143c412 to your computer and use it in GitHub Desktop.
Unhook the Genesis default title function and replace it with your own title-building function
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
<?php | |
// Paste the code BELOW this line into your child theme functions. | |
/** | |
* Unhook the Genesis default title function and replace it with your own title-building function | |
* | |
* @author Reasons to Use Genesis | |
* @link http://reasonstousegenesis.com/genesis-default-title/ | |
*/ | |
remove_filter( 'wp_title', 'genesis_default_title', 10, 3 ); | |
add_filter( 'wp_title', 'rtug_sample_title_function', 10, 3 ); | |
function rtug_sample_title_function( $title, $sep, $seplocation ) { | |
if ( 'right' === $seplocation ) | |
return $title . ' ' . $sep . ' ' . get_bloginfo( 'name' ); | |
else | |
return get_bloginfo( 'name' ) . ' ' . $sep . ' ' . $title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment