I need some help adjusting my wordpress theme using conditional tags.
I want to be able to say "if home then show title 'X', if a category show the category title, if post show the post title, if page show the page title" for my h1 tag and html title tag.
I went through the conditional tag information here but can't wrap my mind around it.
Any help is appreciated.
Thanks,
Dan
I really just need help with how to make the title of a page to appear, I've got home, posts, and categories.
This is what I have so far:
<?php
if (is_home()) {
echo "TITLE" ;
} elseif (is_category()) {
single_cat_title('');
} elseif (is_page()) {
;
} elseif (single_post_title()){
the_title('');
}
?>
Help is very much appreciated.
Thanks,
Dan
It helps to know *where* this information is being displayed on your templates. But just going with what you have above:
<?php
if (is_home()) {
echo "TITLE";
} elseif (is_category()) {
single_cat_title();
} elseif (is_page() || is_single()) {
the_title();
}
?>
Note that Pages and posts use the same template tags for displaying "post" content, so I merely combined them under the same elseif(). More on conditional tags is found here:
http://codex.wordpress.org/Conditional_Tags