Ready to get started?Download WordPress


[resolved] Get post information before loop (4 posts)

  1. jeremyduffy
    Posted 3 years ago #

    I want to make the menus change depending on the postname of the page I'm viewing or the template it has or the parent it belongs to. How do I test any of those things before the loop? My menu is set in the header.

    I could use Javascript and just hide the elements until the loop, but I'd rather not do it that way if I can avoid it.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

  3. jeremyduffy
    Posted 3 years ago #


  4. jeremyduffy
    Posted 3 years ago #

    By the way, I wanted to point out that while the conditionals alone would probably have done it, using global $post as shown in one of the examples on that page does what I actually wanted and simplifies my job greatly.

Topic Closed

This topic has been closed to new replies.

About this Topic