Skip to content

Commit 1a1a454

Browse files
committed
Remove archive type from titles
1 parent d972f97 commit 1a1a454

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
add_filter('get_the_archive_title', 'lt_remove_archive_types_from_titles');
4+
function lt_remove_archive_types_from_titles($title) {
5+
if (is_category()) {
6+
$title = single_cat_title('', false);
7+
} elseif (is_tag()) {
8+
$title = single_tag_title('', false);
9+
}
10+
11+
return $title;
12+
}

0 commit comments

Comments
 (0)