• My blogroll is a stack of links in the form of images on the right-hand sidebar in a 3-column template (www.executiveapprentice.com.) What I would like to do is use a conditional statement that will prevent this instance of the page links showing up unless the_id() of the post on the index.php is a specific number.

    As I’m posting this, I think I just solved my own problem in my head. Where I was thinking, “if the index is being displayed, don’t show this set of page links, but if the_id() is “X” do show it” I am now thinking that maybe I should do it the other way around.

    If the_id() is “X” then show them, otherwise do nothing. From what I can see, the_id() if placed outside of the loop is either the most recent post, or the current page. Is this correct?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Conditional content in sidebar.php based on the_id()’ is closed to new replies.