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

Sir, i use astra theme and elementor pro plugin. And this is not working on mine. can you please help me how can i remove that,

@Asikur22
Copy link
Author

Asikur22 commented May 15, 2020

As you can see it uses the 'get_the_archive_title' filter to remove the text. if astra and elementor pro had not used this filter in their template. then it will not work. if you need more help plz contact me here [email protected]

@Surajpokhrel
Copy link

Surajpokhrel commented May 15, 2020 via email

@Asikur22
Copy link
Author

Sorry, I don't know. if you want me to fix it then you have to hire me. Thanks

@Surajpokhrel
Copy link

Surajpokhrel commented May 15, 2020 via email

@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