Support » Fixing WordPress » Different page title to sidebar link

  • In order to optimise my page for web traffic, part of the work that I need to do involves altering the <title> tag of the home/index page. (For example, I would like the title tag to say “Speed Reading Courses in London”).

    The page currently appears as “Home” on the sidebar.

    If I change the title tag, it is reflected in the sidebar on the right hand side of the page and the name is too long for the format of my page.

    Can anyone suggest how I can have a name on the sidebar for navigation (e.g. “Home”) that is different to the title tag (e.g. “Speed Reading Courses in London”)?

    Many thanks in advance for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The title tag of your page is rendered in wordpress with wp_title(); which comes out of the options table in the database.

    If you don’t care about making the home page title static, crack open your header.php and put this PHP code in between the <title> tags:

    <?php if(is_home()) { ?>
    Speed Reading Courses in London
    <?php } else { wp_title(); } ?>

    See wp_title and Conditional Tags for more information.

    Is there a way to do this once for all pages in the page template or in where you write the page? Is their a plugin for this? I’ve got quite a few pages I want to create that have longer titles, but doing this requires a static page it seems.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different page title to sidebar link’ is closed to new replies.