WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] getting info about WHERE I am inside the header (3 posts)

  1. Elan42.com
    Member
    Posted 6 years ago #

    Hi...

    I have to create a customized sidebar, not only in the common sidebar (after the loop) but also in the header of my wordpress page.

    So I need two things:

    1) a way to know WHERE I am... functions like in_category and in_page force me to consider infinite cases...
    I just need to know:
    - the category where I am
    - the mother page where I am

    2) Also, I need a way to use variables inside all my wordpress blog.
    I want to define a $where_i_am variable to change dynamically my header menu behaviour, so, How do I do that?
    Using a variable in the theme index is useless cause in the header, sidebar, and so on... the variable is always null.
    I have register_globals = off but I also use to force a "global $where_i_am" without success.
    I also tryed to register the variable inside something like $_GLOBALS['where_i_am']... without success.

    Thanks.

  2. Elan42.com
    Member
    Posted 6 years ago #

    There is no solution?

    Maybe I have to do the header inside the loop even if It have no logical sense?

  3. Elan42.com
    Member
    Posted 6 years ago #

    I resolved with this topic for get the top-parent page.

    For the variables, I used $_SESSION

    I will think about a better way in the future.

Topic Closed

This topic has been closed to new replies.

About this Topic