function ganesh_archive_title($title){
if ( is_category() ) {
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), single_cat_title( '', false ) );
} elseif ( is_tag() ) {
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), single_tag_title( '', false ) );
} elseif ( is_author() ) {
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), '<span class="vcard">' . get_the_author() . '</span>' );
} elseif ( is_year() ) {
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), get_the_date( esc_html_x( 'Y', 'yearly archives date format', 'himalayasunrise' ) ) );
} elseif ( is_month() ) {
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), get_the_date( esc_html_x( 'F Y', 'monthly archives date format', 'himalayasunrise' ) ) );
} elseif ( is_day() ) {
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), get_the_date( esc_html_x( 'F j, Y', 'daily archives date format', 'himalayasunrise' ) ) );
}elseif ( is_post_type_archive() ) {
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), post_type_archive_title( '', false ) );
} elseif ( is_tax() ) {
$tax = get_taxonomy( get_queried_object()->taxonomy );
$title = sprintf( esc_html__( '%s', 'himalayasunrise' ), single_term_title( '', false ) );
}
return $title;
}
add_filter('get_the_archive_title', 'ganesh_archive_title');
No comments:
Post a Comment