WordPress

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

Rahul Prajapat

I’m Rahul Prajapat. I’m a WordPress developer and Author at TheCodeHubs. I have good skill of Html, CSS, JQuery, SQL, Web API, PSD to HTML/PSD to WordPress, WordPress Theme/Plugin Customization, create or modify short code, customize visual composer short code or integrate new short code with visual composer, can create custom metabox for any post type in WordPress admin.

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

2 years ago