WordPress.org

Ready to get started?Download WordPress

Ideas

Combine multiple categories in one Menu item

  1. baszer
    Member

    12345

    I really like the new function to add a category to the menu bar. But what I really like, is to the function to combine 2 categories to one menu link.

    for example: the category White and the Category Rabbits, so you can make a link called: "white rabbits" and the user gets a list of all white rabbits.

    Posted: 2 years ago #
  2. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod

    You'd have to make a custom link for that.

    Make your URL http://www.example.com/?cat=(id-white),(id-rabbit)

    Posted: 2 years ago #
  3. baszer
    Member

    12345

    Ow ok! Cool :)

    Posted: 2 years ago #
  4. shazdeh
    Member

    Ipstenu, what other query objects can be accessed via url like 'cat'?
    I'm asking because I was actually thinking about building a plugin that would enable to query posts using url (like /?author=1,2&cat=-4).
    Also, the code which makes 'cat' parameter in url possible, do you know where it is located in core?

    Posted: 2 years ago #
  5. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod

    shazdeh - Not a clue where that's in core. I'd email the wp-hackers mailing list to ask about that one, though :)

    Posted: 2 years ago #
  6. baszer
    Member

    12345

    and how would you do it when you change the permalinks? I changed the permalinks to http://www.example.info/2012/02/example-post/

    For a non programmer its still pretty hard... ;)

    Posted: 2 years ago #
  7. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod

    Changing permalinks does not effect the functionality of http://www.example.com/?cat=(id-white),(id-rabbit)

    Really, it'll work no matter WHAT your permalinks are :)

    Posted: 2 years ago #
  8. baszer
    Member

    12345

    ok, but now I get all the white and all the rabbits, I only want the white rabbits...

    Posted: 2 years ago #
  9. Jeremy Clarke
    Member

    Use a + instead of a , if you want only posts in both.

    http://www.example.com/?cat=(id-white)+(id-rabbit)

    This also work with pretty permalinks:

    http://www.example.com/category/white+rabbit

    What I want is a way to programattically generate a link to two categories that way. I know I can use ?cat=, but I'd rather have a core function take care of it.

    Posted: 2 years ago #
  10. esmi
    Forum Moderator

    This has nothing to do with Accessibility.

    Posted: 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    6 Votes
  • Status

    This idea is under consideration