Answers for "Remove prefix on category title"

PHP
0

Remove prefix on category title

function prefix_category_title( $title ) {
 if ( is_category() ) {
  $title = single_cat_title( '', false );
 }
return $title;
}

add_filter( 'get_the_archive_title', 'prefix_category_title' );
Posted by: Guest on June-22-2021
0

remove prefix on category title

if ( is_category() ) {
        $title = sprintf( __( 'Category: %s' ), single_cat_title( '', false ) );
    } elseif ( is_tag() ) {
        $title = sprintf( __( 'Tag: %s' ), single_tag_title( '', false ) );
    } elseif ( is_author() ) {
        $title = sprintf( __( 'Autor: %s' ), '<span class="vcard">' . get_the_author() . '</span>' );
    }

//directory: wp-includes
//file: general-template.php
//find function: get_the_archive_title() change:
Posted by: Guest on June-22-2021

Browse Popular Code Answers by Language