WordPress.org

Ready to get started?Download WordPress

Forums

Help with variables like $single, $month, etc (3 posts)

  1. joshteeters
    Member
    Posted 9 years ago #

    I'm trying to get my sidebar to show different things based on what kind of page you're on. I've got it working how I want thus far. I've removed various elements from the sidebar whenever a user is on a single post page or a month listing.

    I did this by using:

    'if (!$single && !$month) { display stuff }'

    I want to remove the same elements from PAGES, as well, and I don't know the variable for it. (I tried $page, which didn't work.) Is there a list of the variables? Or could someone at least tell me the variable I need to add to my IF statement to remove the sidebar elements from pages?

  2. oriecat
    Member
    Posted 9 years ago #

    THe list of conditional tags is here:
    http://codex.wordpress.org/Conditional_Tags

    But they are formatted differently from how you said you did it, so hmm.

    Maybe if you converted your current code to the is_page() type code, then they would all work?

  3. joshteeters
    Member
    Posted 9 years ago #

    Thanks for the link! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.