PHP for adding page title – problem with title of static front page
-
I’m having a problem getting my ‘static front page’ title to display correctly. My theme (html5 reset) has the following code in header.php:
<title> <?php if (function_exists('is_tag') && is_tag()) { single_tag_title("Tag Archive for ""); echo '" - '; } elseif (is_archive()) { wp_title(''); echo ' Archive - '; } elseif (is_search()) { echo 'Search for "'.wp_specialchars($s).'" - '; } elseif (!(is_404()) && (is_single()) || (is_page())) { wp_title(''); echo ' - '; } elseif (is_404()) { echo 'Not Found - '; } if (is_home() && is_front_page()) { bloginfo('name'); echo ' - '; bloginfo('description'); } else { bloginfo('name'); } if ($paged>1) { echo ' - page '. $paged; } ?> </title>
If I use the WP default setting of ‘latest posts’ as my front page then I get the desired title format for the front page: ‘name – description’
If I change to use a static page as front page then I end up with the following title format for the front page: ‘(blank) – name’ – where (blank) is just completely empty.
Can somebody please help and advise as to what I nead to add to the3 above for it to display the title of the static front page as: ‘name – description’
TIA
Marc
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘PHP for adding page title – problem with title of static front page’ is closed to new replies.