SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Most recent post title is appearing on the home page title of wordpress blog?

    I'm playing around with wordpress locally on my machine.

    On my header.php file, this is how the code looks like:

    Code HTML4Strict:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
     
    <head>
    	<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    	<meta name="author" content="Kenneth Jaysone" />
    	<link href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" rel="stylesheet" />
     
     
    	<title><?php bloginfo('name'); ?><?php the_title(' - '); ?></title>
    </head>

    If you want to see the code clearly, you can also go the the page below:

    http://pastie.org/612107

    blog name: Wordpress Forest

    My problem is when i'm on the home page (http://localhost/wordpress), the title i'm getting is Wordpress Forest - My First Post

    I don't think this should happen as the home page title should just be - Wordpress Forest.

    When i go to a single post page, i get the Wordpress Forest - My first Post.

    This is ok, how do i make the home page just display the Title of my blog?

    Thanking you in advance
    Jaysone

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Change this:
    HTML Code:
    <title><?php bloginfo('name'); ?><?php the_title(' - '); ?></title>
    To this:
    HTML Code:
    <title><?php bloginfo('name'); ?><?php if (!is_home()) the_title(' - '); ?></title>

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you

    I've been reading the template tags page and the function reference alot..

    Didn't realise a conditional comments page that explains alot of these functions, thanks again.
    Jaysone


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
  •