Please help with dynamic text on my blog

Discussion in 'PHP' started by Sxperm, Mar 1, 2007.

  1. #1
    Hi,

    I am using template that retrieve $title to be displayed as first sentence/H1 tag in my page. It is good because this text will be changed automatically when blog title changed. However, I'm using long title in homepage and I don't want this text too much long for homepage only. How can I replace this with my own custom text for first page only while it still dynamic when page title change for others page. Here is current code

    <?php
    if ( is_home() ) {
    bloginfo('title');
    } else {
    echo($title);
    }
    ?>
    Code (markup):
    Please suggest me.
     
    Sxperm, Mar 1, 2007 IP
  2. sadcox66

    sadcox66 Spirit Walker

    Messages:
    496
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    <?php
    if ( is_home() ) {
    $title='Title at home page';
    }
    ?>
    
    Code (markup):
     
    sadcox66, Mar 1, 2007 IP