Skip to content

Instantly share code, notes, and snippets.

@caralgar
Created November 4, 2015 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save caralgar/10be55d9b5a3f4896288 to your computer and use it in GitHub Desktop.
Save caralgar/10be55d9b5a3f4896288 to your computer and use it in GitHub Desktop.
How to remove Category:, tag:, etc from the_archive_title()
<?php
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>' ;
}
return $title;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment