Add Custom Meta to Archive Title
This snippet adds custom meta information to the archive title, providing more context for users browsing archives.
PHP
function add_meta_to_archive_title($title) {
if (is_category()) {
$title .= ' - Category Archive';
} elseif (is_tag()) {
$title .= ' - Tag Archive';
} elseif (is_author()) {
$title .= ' - Author Archive';
}
return $title;
}
add_filter('get_the_archive_title', 'add_meta_to_archive_title');
Snippet Feedback
Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY