WordPress.org

Ready to get started?Download WordPress

Ideas

Customize Conditional Tag

  1. tsguitar
    Member

    12345

    It would be nice to change the conditional tag for a page. For instance, I create location archives by searching the custom fields. I use the search function of WordPress, but I don't want those specific search results to be called 'is_search'; I want them to be 'is_archive'. Also, for any times that you're uncertain of what conditional tag would apply for a given page, being able to set it yourself would help. This might also make for times where your code is easier to maintain because you don't have to allow for so many conditions if you never use certain tags.

    The ability to name your own conditional tags would be nice, too, instead of just picking from a bank of existing tags.

    Posted: 7 years ago #
  2. Mark Jaquith
    Moderator

    These things should be possible now. You are free to modify the is_* vars and modify the logic that chooses a certain template for a certain type of request, and you can definitely add your own new types of requests.

    Posted: 7 years ago #
  3. markjaquith: is there any documentation about it?

    Posted: 7 years ago #
  4. tsguitar
    Member

    12345

    Documentation about this would be nice. My suspicion is that this is a very hidden feature right now. A streamlined process (through a GUI maybe) in the future would allow more people to take advantage of this. In the meantime, give with the way to make this happen!

    Posted: 7 years ago #
  5. sophiedennis
    Member

    12345

    Seconded tsguitar. If this *is* already possible, documentation in the codex is needed. If there *is* already documentation in the code, it needs to be easier to find!

    Posted: 7 years ago #
  6. Justin Shreve
    Member

    As Mark stated this exists. there are too many different articles depending on what you want to edit in terms if if...else statements but since the templates use PHP conditions it's already customizable.

    Posted: 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    94 Votes
  • Status

    This idea has been implemented