Skip to content

Instantly share code, notes, and snippets.

@vyskoczilova
Last active November 28, 2017 10:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vyskoczilova/58ba78eeca237e829424cc424530f73e to your computer and use it in GitHub Desktop.
Save vyskoczilova/58ba78eeca237e829424cc424530f73e to your computer and use it in GitHub Desktop.
WP - Remove “Category:”, “Tag:”, “Author:” from the_archive_title
<?php
add_filter( 'get_the_archive_title', function ($title) {
// archiv rubriky
if ( is_category() ) {
$title = single_cat_title( '', false );
// archiv štítku
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
// archiv autora
} elseif ( is_author() ) {
$title = get_the_author();
}
return $title;
});
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment