2

I use wp_title to generate some kind of breadcrumb and it works well, but in there I have the title of the site, and I want to delete that. It looks like this:

Taxonomy1: City | Title of the site. I get that by using <?php wp_title(); ?>.

How can I delete the title of the site in that output?

1

Take a look in header.php of your theme. Some themes have the title output like this:

<title><?php wp_title('|', true, 'right'); ?> | <?php echo get_bloginfo('name') ?></title>

So you'll have to remove the | <?php echo get_bloginfo('name') ?> part.

However you should keep the title of the site in the <title> for SEO purposes.

1

There is probably a third-party filter running on the wp_title. Remove it before you call the function:

remove_all_filters( 'wp_title' );
wp_title();
0

You could use a plugin like WordPress SEO by Yoast and set templates for so if your title tags. You would then have the ability to override your templates at the post/page/category level

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.