darthmortar
Member
Posted 2 years ago #
How do I change the <TITLE></TITLE> tag so it displays the following;
On main site e.g. Welcome | blogname
On singel post e.g. post title | blogname
On single page e.g. page title | blogname
With <?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blogg arkiv <?php } ?> <?php wp_title(); ?> it shows the blogname first and then where the visitor are, if I change the order I get those >> in wrong places...
<?php if ( is_single() ) { ?> Welcome » <?php bloginfo('name'); ?> <?php } ?> <?php wp_title(); ?>
or consider something like this :
<title>
<?php
if (is_home()) {
echo bloginfo('name'); /** Or whatever you want**/
} elseif (is_404()) {
echo '404 Not Found'; /** Or whatever you want**/
} elseif (is_category()) {
echo 'Category:'; wp_title('');
} elseif (is_search()) {
echo 'Search Results'; /** Or whatever you want**/
} elseif ( is_day() || is_month() || is_year() ) {
echo 'Archives:'; wp_title('');
} else {
echo wp_title('');
}
?>
</title>
Also, you might consider using the All In One SEO Pack for wordpress