[Resolved] Remove "Taxonomy:"

Home Forums Support [Resolved] Remove "Taxonomy:"

Home Forums Support Remove "Taxonomy:"

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #632144
    supazena

    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

    #632367
    David
    Staff
    Customer Support

    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/

    #632535
    supazena

    Hi David,
    Thanks for your answer. In fact I dont talk aboutURL structure but just the Hn balise on top of those taxonomies’ archive

    #632875
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

    #632933
    supazena

    Hi Tom,
    you’re the one ! That’s perfect !
    Thank you so much.
    Regards

    #633282
    Tom
    Lead Developer
    Lead Developer

    Awesome, glad I could help! ๐Ÿ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.