Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom taxonomy "Portfolio Categories", and a few these categories say "Cloth", "Shoes", ...

When open some category page, i want the title to be like 'Site Name | Cloth', but with wp_title(), it becomes 'Site Name | Portfolio Categories | Cloth'

How do i remove the "Portfolio Categories" from the title?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Hi @Edward:

This is not a generic solution but will probably solve your needs. If you want to get rid of the '| Portfolio Categories' from your site's title just hook the 'wp_title' filter in your theme's functions.php file and remove that from the title string. Copy this code to the bottom of that file and modify as need be:

add_filter('wp_title','your_wp_title');
function your_wp_title($title) {
  $title = str_replace('| Portfolio Categories','',$title);
  return $title;
}  
share|improve this answer
    
Pretty simple and straightforward, thanks –  Edward Jan 12 '11 at 3:53
    
@Edward - Yes, sometimes what we need is simple, which is nice. :) –  MikeSchinkel Jan 12 '11 at 18:45
    
@MikeSchinkel - I posted a similar question here, looking for the generic solution: wordpress.stackexchange.com/questions/29020/… –  supertrue Sep 20 '11 at 18:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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