Support » Fixing WordPress » How to remove the "-" on the homepage title?

  • Resolved sienna071


    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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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?

    Yeah, I’ve just found where the problem is in the theme..

    		      if (function_exists('is_tag') && is_tag()) {
    		         single_tag_title("Tag Archive for &quot;"); echo '&quot; - '; }
    		      elseif (is_archive()) {
    		         wp_title(''); echo ' Archive - '; }
    		      elseif (is_search()) {
    		         echo 'Search for &quot;'.wp_specialchars($s).'&quot; - '; }
    		      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; }

    What would I have to change so that only the homepage loses the hyphen?

    Have you tried resetting it?

    if, elseif, elseif, elseif, elseif, elseif, THEN an if, THEN an else, and a final if – seems improper.

    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!

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to remove the "-" on the homepage title?’ is closed to new replies.