How To Change Taxonomy Page Or Archive Page Title In WordPress

Here we learn about how to change the taxonomy page or archive page title in WordPress.

Custom code copied and paste into your child theme’s functions.php file.

<?php
add_filter( 'get_the_archive_title', 'myblog_customize_archive_page_title', 10, 1 );
function myblog_customize_archive_page_title( $title ) {
    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_tax( 'video-categories' ) || is_tax( 'video_tag' ) ) {
    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    $title = $term->name;
  }
  return $title;
}
?>

OUTPUT:

1) Category page

2) tag page

3) author page

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe

Select Categories