Skip to content

Instantly share code, notes, and snippets.

@reasonstousegenesis
Created May 11, 2015 11:28
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 reasonstousegenesis/91a322092bb3a143c412 to your computer and use it in GitHub Desktop.
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
<?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