How to change texonomy page or archive page title in wordpress

For change archive page title or customize archive page title just paste below code into your theme's functions.php file and change as per your need.

add_filter( 'get_the_archive_title', 'rj_customize_archive_page_title',10,1 );
function rj_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;

}

Comments

Popular posts from this blog

How to add a custom sorting or order by option on category archive or product archive page in woocommerce wordpress

How to create a custom wp_list_table and bulk action in wordpress

How to add image option in nav menu in wordpress