Archived topic
Remove "Taxonomy:"
5 replies · Started by supazena on July 25, 2018
Hi,
I created a taxonomyA and some with sub categories sub1-taxonomyA (tools : WCK Taxonomy Creator)
When I'm on http://www.mywebsite.com/taxonomyA/sub1-taxonomyA the title in the head of the archive page display :
taxonomyA : sub1-taxonomyA
I search a solution to only display "sub1-taxonomyA" (so remove "taxonomyA :") My english is not so godd and I have some diffiiculty finding a solution.
Hope you could help or bring me some advice
Hi there,
SEO plugins like Yoast would allow you to change the URL structure. Or alternatively a plugin like this automatically removes the base category:
https://wordpress.org/plugins/remove-category-base-littlebizzy/
Hi David,
Thanks for your answer. In fact I dont talk aboutURL structure but just the Hn balise on top of those taxonomies' archive
Hi there,
Give this function a try:
add_filter( 'get_the_archive_title', function( $title ) {
if ( is_tax() ) {
$title = single_term_title( '', false );
}
return $title;
}, 20 );
Let me know :)
Hi Tom,
you're the one ! That's perfect !
Thank you so much.
Regards
Awesome, glad I could help! :)