2024-01-09 16:13:20 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Archive title customization.
|
|
|
|
* Get rid of the "Category:" "Tag:" "Author:" "Archives:" lables in
|
|
|
|
*
|
|
|
|
* https://developer.wordpress.org/reference/functions/get_the_archive_title/#comment-1807
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2024-01-13 15:46:11 +01:00
|
|
|
function xarxaprod_archive_title( $title ) {
|
2024-01-09 16:13:20 +01:00
|
|
|
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>';
|
|
|
|
} elseif ( is_post_type_archive() ) {
|
|
|
|
$title = post_type_archive_title( '', false );
|
|
|
|
} elseif ( is_tax() ) {
|
|
|
|
$title = single_term_title( '', false );
|
|
|
|
}
|
|
|
|
|
|
|
|
return $title;
|
|
|
|
}
|
|
|
|
|
2024-01-13 15:46:11 +01:00
|
|
|
add_filter( 'get_the_archive_title', 'xarxaprod_archive_title' );
|