• I’ve added text to my sidebar.php but I only want it on the first page. I don’t mind to have the sidebar on other pages or in the comments section. But, how do I make it to where I can have the text still on my main page but not anywhere else on my blog?????

Viewing 4 replies - 1 through 4 (of 4 total)
  • You’ll want to check out the Conditional Tags.

    You could do something like:

    if (is_home())
    {
    // Your stuff goes here for display ONLY on the home page

    }

    Thread Starter allover

    (@allover)

    I am so new to WordPress. I’ve tried reading everything I can but always seem to be going in circles because there is just so much information it seems overwhelming at times.

    I’ve read about Conditional Tags but really can’t make sense of it because I don’t know what all that Code means. And that is another problem in itself. Where did you start off when using WordPress? Even your suggestion is confusing to me. Am I suppose to just copy and paste what you wrote into my sidebar.php?

    You can get a lot done in WP without having to delve into code… but at some point, if you want to make those special tweaks… time to put the learnin’ hat on.

    I come at WP from a bit of a different angle… I’m a professional geek, but a php newb, so I spend a lot of time dissecting other peoples’ themes to see how THEY did it. ?? Then I commence to borrowin’.

    What I put in my previous reply is something like what you would use in your theme’s sidebar.php, yes. The is_home() conditional is just a quick way to see where the viewer is at. You can get a more complete example further down on the codex page for some conditional sidebar coding (here).

    To flesh out my earlier example to a bit more “copy-and-pasteable”:

    <?php
    if (is_home()) {

    echo "<ul>";
    ech "<li>Your Text Goes Here!";
    echo "</ul>";
    } ?>

    Thread Starter allover

    (@allover)

    Phew, I think I just need to study PHP more. I am really trying to wrap my head around everything because of all the tweaks I want on my website. There’s just so much information it’s difficult to know where to start and end. The WP documentatin can be a bit confusing for complete newbies because it throws so many links and information at you. But maybe it’s just me. I tend to overcomplicate things.

    Anyway, thanks for you help. I’m pretty sure I’m pointed in the right direction. I just need to figure it out now. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Will someone Please help me with my sidebar?’ is closed to new replies.