Skip to content

Instantly share code, notes, and snippets.

@amielucha
Last active August 29, 2015 14:23
Show Gist options
  • Save amielucha/0307becb8262e133fe0e to your computer and use it in GitHub Desktop.
Save amielucha/0307becb8262e133fe0e to your computer and use it in GitHub Desktop.
// Removes the 'Project Category:' or 'Category:' part in archive's h1
add_filter( 'get_the_archive_title', function ($title) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
$title = '<span class="vcard">' . get_the_author() . '</span>' ;
} elseif ( is_tax() ) {
$title = single_term_title( '', false );
} elseif ( is_archive() ) {
$title = post_type_archive_title( '', false );
}
return $title;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment