Created
April 10, 2019 17:45
-
-
Save Asikur22/9f32ae95b09fbc6f1ebe2b35498f35c9 to your computer and use it in GitHub Desktop.
[Remove Text “Category:”, “Tag:”, “Author:”, “Archives:” and Other Taxonomy Name From Archive Title] #WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Remove Text "Category:", "Tag:", "Author:", "Archives:" and "Other Taxonomy Name:" From Archive Title | |
| */ | |
| function das_archive_title_modification( $title ) { | |
| if ( is_category() ) { | |
| $title = single_cat_title( '', false ); | |
| } elseif ( is_tag() ) { | |
| $title = single_tag_title( '', false ); | |
| } elseif ( is_author() ) { | |
| $title = '' . get_the_author() . ''; | |
| } elseif ( is_post_type_archive() ) { | |
| $title = post_type_archive_title( '', false ); | |
| } elseif ( is_tax() ) { | |
| $title = single_term_title( '', false ); | |
| } | |
| return $title; | |
| } | |
| add_filter( 'get_the_archive_title', 'das_archive_title_modification' ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
plz send me your skype or whatsapp info on my mail. Thanks