0

I have a custom taxonomy called 'Genres' within that I have various taxonomies: 'Paintings' 'Drawings' etc. I use the code below to create my page titles.

When viewing the taxonomy page for 'Paintings' I get a page title 'Paintings | Genres | BlogName' whereas I wanted to display only: 'Paintings | BlogName', how can I do that?

<title><?php
    /* Print the <title> tag based on what is being viewed */
    global $page, $paged;

    wp_title( '|', true, 'right' );

    // Add the blog name.
    bloginfo( 'name' );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );

    if ( $site_description && ( is_home() || is_front_page() ) )
        echo " | $site_description";    
    ?></title>
1

You should use the wp_title filter, see: other question

They are creating a separate function that handles the output.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.