sienna071
Member
Posted 10 months ago #
WordPress has automatically given the webpage's title in the format of:
Page Title - Site Name
which is good on all pages but the homepage. The homepage is a static home page, but it is coming up as "- Site Name".
What can I do to remove this hyphen on the homepage only?
Try resetting your static page. See if you yourself have added the "-" to the site name.
Does your theme have an option for switching the h1 and h2 header tags?
sienna071
Member
Posted 10 months ago #
Yeah, I've just found where the problem is in the theme..
<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()) {
bloginfo('name'); echo ' - '; bloginfo('description'); }
else {
bloginfo('name'); }
if ($paged>1) {
echo ' - page '. $paged; }
?>
</title>
What would I have to change so that only the homepage loses the hyphen?
Roselienjessie
Member
Posted 10 months ago #
Have you tried resetting it?
if, elseif, elseif, elseif, elseif, elseif, THEN an if, THEN an else, and a final if - seems improper.
sienna071
Member
Posted 7 months ago #
sorry I'm still unsure of what to change.
I am very new to php so if someone could advise me as to what of the above code needs to change so that when on my homepage it drops the hyphen before the Site name, that would be very much appreciated!
RS Publishing
Member
Posted 7 months ago #
you obviously know what you are looking for already. if i may, which page is this (posted above)? header.php? if not, have a look there.