WordPress.org

Ready to get started?Download WordPress

Forums

Different page title to sidebar link (3 posts)

  1. spercy
    Member
    Posted 8 years ago #

    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!

  2. eston
    Member
    Posted 8 years ago #

    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.

  3. jrothra
    Member
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags