SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress problem in title

    I am using the following code to display the word Home if its the home page, else the page title for other pages, in my website. However on the home page I dont get the word 'Home' output, just blank space and the bloginfo('name') details, what is the problem? Thanks

    BDW I have created a page named Home and set wordpress settings to point to this 'Home' page as the homepage of my site.

    `<title>
    <?php if (is_home()) { echo 'Home'; /*bloginfo('description');*/ ?>
    &mdash;
    <?php } else { wp_title('',true); ?>
    &mdash;
    <?php } ?>
    <?php bloginfo('name'); ?>
    </title>`

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You may want to give this plug in a look: http://www.netconcepts.com/seo-title-tag-plugin/

  3. #3
    SitePoint Member
    Join Date
    Feb 2010
    Location
    Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All plug in is require for wordpress support and wordpress have few limitation with home and home page.

    Thanks,
    Morris

  4. #4
    SitePoint Addict
    Join Date
    Mar 2006
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using if(is_front_page()) instead of if(is_home())

    Alternatively you can use if(is_page('Home')) since you titled that page Home.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •