Skip to content

Instantly share code, notes, and snippets.

@slaffko1
Created March 11, 2020 14:14
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 slaffko1/1a24b256c7fecf930cfeb7d9cd4a6836 to your computer and use it in GitHub Desktop.
Save slaffko1/1a24b256c7fecf930cfeb7d9cd4a6836 to your computer and use it in GitHub Desktop.
Remove "Category:" from title
function prefix_category_title( $title ) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif(is_product_category()) {
$term = get_queried_object();
$title = $term->name;
}
return $title;
}
add_filter( 'get_the_archive_title', 'prefix_category_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment