[resolved] How to remove the "-" on the homepage title? (8 posts)

  1. sienna071
    Posted 4 years 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?

  2. Krishna
    Posted 4 years ago #

    Try resetting your static page. See if you yourself have added the "-" to the site name.

  3. Pioneer Web Design
    Posted 4 years ago #

    Does your theme have an option for switching the h1 and h2 header tags?

  4. sienna071
    Posted 4 years ago #

    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?

  5. Roselienjessie
    Posted 4 years ago #

    Have you tried resetting it?

  6. Pioneer Web Design
    Posted 4 years ago #

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

  7. sienna071
    Posted 3 years 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!

  8. RS Publishing
    Posted 3 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.