Support » Plugins » Hacks » Which php code? Text area above posts only on homepage

  • Hi all,

    I’m looking for some quick help. I’m looking to place a block of text in the exact same place as shown in the navigation area which states “You are here: Home / Cookies / Monster Cookies” but displays only on the home page and not on any archives, posts or pages. See this page to see what I mean:

    I’m a complete newbie to php coding and am using a plugin by Genesis (Simple Hooks) to achieve this. I’ve found the right area in which to place my HTML code but I don’t know how to make it show only on the home page. I found this WordPress information ( but when applying it, I think I’m doing something wrong.

    I just want some HTML code to welcome any users that land on my homepage with some social networking things. Something along the lines of…

    <?php is_home(); ?>
    <div class="breadcrumb">
    <p>Welcome to Sweet 2 Eat Baking. If you are new here, you might like to subscribe to our RSS Feed or get sugar filled e-mails! You'll be the first to get updates! You can also find me over at Twitter, Facebook, and Pinterest. You can also read more about me here. Happy baking!</p>

    If I enter the above in, it displays just fine but shows on every page. What am I doing wrong? I’m assuming its either because..
    1). I’ve not closed the php tag? I don’t know any php therefore I don’t know what I’m doing at all with that.
    2). I’m using the wrong code from the conditional tags page. Which tag or code would I use to ensure that my HTML only displays on just the homepage of my site?

    Thanks in advance,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    You’re close, you just misunderstood how to properly use is_home(). Probably because the Usage section of is_home() in the Codex is misleading. Change the first line to: <?php if( is_home() ): ?> and then add this line after all your conditional html: <?php endif; ?>. Note the different use of colon vs. semi-colon.

    Wonderful, thank you so much. It’s working perfecto now.

    Thanks for your help and time. I appreciate it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Which php code? Text area above posts only on homepage’ is closed to new replies.