Created
October 26, 2015 12:34
-
-
Save mateusneves/b3352ce8ce5599d8ffbf to your computer and use it in GitHub Desktop.
Remove the taxonomy name from wp_title() function
This file contains hidden or 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
function mamaduka_remove_tax_name( $title, $sep, $seplocation ) { | |
if ( is_tax() ) { | |
$term_title = single_term_title( '', false ); | |
// Determines position of separator | |
if ( 'right' == $seplocation ) { | |
$title = $term_title . " $sep "; | |
} else { | |
$title = " $sep " . $term_title; | |
} | |
} | |
return $title; | |
} | |
add_filter( 'wp_title', 'mamaduka_remove_tax_name', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment