WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to identify views. (5 posts)

  1. ssdesign
    Member
    Posted 6 years ago #

    Hi,
    I am searching for a way to find out what is the current view of my blog pages.

    For example, by using "if (is_archive()) " I can know that the page is an archive page.

    Similarly, I want to find the code to know the following:

    1. Categories view.
    2. Calendar view (months)
    3. Calendar view (date)

    The reason I want to do this is because I have made the sidebar into an accordion and based on what is the link that the user clicked from the accordion, I want to open and close the accordion items.

    My accordion contains following:
    1. Latest Posts
    2. Categories
    3. Calendar
    4. Categories

    They are all closed in the begining.

    Assuming the user opened the Calendar. The accordion expands to show the calendar. Then the user clicks one of the date in the calendar to view posts from that date.

    Here what I want is some way to identify that that a "date" was clicked.

    This would allow me to keep the Calendar view in the accordion open then the page reloads.

    Same for the other things i listed above.

    My question is, are there more such functions like "if (is_archive()) " which I can use?

    Thanks for your help.

  2. ssdesign
    Member
    Posted 6 years ago #

    hi, anybody has any suggestions for this issue?

    Still trying to find my way around it.

    thanks.

  3. Chris_K
    Member
    Posted 6 years ago #

    Have you looked over the Conditional_Tags page?

  4. ssdesign
    Member
    Posted 6 years ago #

    wow, thanks a lot for this pointer.

    This would definitely help me in what I want to achieve :)

    I would be soon releasing this template as open-source.

  5. ssdesign
    Member
    Posted 6 years ago #

    Great, this worked.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic