• I would like a block of text under my header and above my posts to only appear on the homepage. Currently I have the text inserted in my templates index.php, so it appears on every page. How can I get the block of text to only appear on the homepage and nothing else? I am running WordPress 1.5.1 and FastTrack theme. My blog is located at https://www.zachkarst.com/wp. I have searched on Google and the WordPress forums but can’t find a solution to my problem. All I have found is a plugin that will make a full static homepage. All help would be greatly appreciated.

Viewing 4 replies - 16 through 19 (of 19 total)
  • There’s nothing between the

    <?php if(empty($_SERVER['QUERY_STRING'])) { ?>

    and the

    <?php } ?>

    What text in your index.php do you want to display only on the home page? I assume it’s the welcome message, so surround that with the PHP above. Place the:

    <?php if(empty($_SERVER['QUERY_STRING'])) { ?>

    before the start of your text, and

    <?php } ?>

    just after it ends.

    Thread Starter macguy22

    (@macguy22)

    Thank you so much, my problem is solved. That was a really stupid mistake on my part.

    “That was a really stupid mistake on my part.”

    Only if you’ve been programming in PHP for a while. Otherwise it was just a mistake. :)

    Okay…i am trying to put something on my homepage as well…but I am not sure where to put the code above in the index.php page…please help!
    ‘<?php if(empty($_SERVER[‘QUERY_STRING’])) { ?>’

    ‘fmblog_get_latest(10);’

    ‘<!-fmblog->’

    ‘<?php } ?>’

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Have Text Only Appear on Homepage’ is closed to new replies.