Skip to content

Instantly share code, notes, and snippets.

@Asikur22
Created April 10, 2019 17:45
Show Gist options
  • Select an option

  • Save Asikur22/9f32ae95b09fbc6f1ebe2b35498f35c9 to your computer and use it in GitHub Desktop.

Select an option

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
/*
* 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' );
@Surajpokhrel
Copy link

Surajpokhrel commented May 15, 2020 via email

@Asikur22
Copy link
Author

we can talk that privately :P

@Surajpokhrel
Copy link

Surajpokhrel commented May 15, 2020 via email

@Asikur22
Copy link
Author

plz send me your skype or whatsapp info on my mail. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment