I'm trying to custom the title of the category "Sports" still doesn't work. It gives me the default title.
<?php if (is_category('Sports')) { ?>
<title>Sports Category</title>
<?php } else { ?>
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' |'; } ?> <?php bloginfo('name'); ?></title>
<?php } ?>
Thank you so much in advance for the help.
Try in_category('Sports') instead of is_category('Sports')
http://codex.wordpress.org/Function_Reference/in_category
(Note: not tested!)
@zoonini I would use in_category('Sports') if I'm trying to custom the title of any "post" in the Sports directory but is_category('Sports') means I'm targeting the Category page itself which is what I'm trying to do.
Thank you.
are you using this code snippet in header.php?
any caches activated?
link to your site?
there might be some other code before it that could interfere, but his is diffficult to tell seeing the code in isolation.
if you like, you could paste the full code of the template with your snippet into a http://pastebin.com/ and post the link to it here.
Ah - sorry, I misunderstood what you were trying to do.
First off - just to double-check, is your category name spelled with a capital "S"?
Can you try this simple test to narrow down the issue and tell me what happens?
<?php if (is_category('Sports')): >?
<title>Sports Category</title>
<?php else: ?>
<title>Default Title</title>
<?php endif; ?>
@alchymyth & zoonini
Never mind, thanks for trying to help me. My code if perfectly fine but it doesn't work because I use 'All In One SEO' which is already re-writing the titles and blocking any Customization trials.
Thanks again for your help.
Ah - that would do it. ;-) Thanks for reporting back.