I need to add an additional filter based on a category for posts that have a custom post_type.

For example, I have a page located at /category/tasks that lists all tasks. I need to make it so I can have additional pages that filter even further like /category/tasks/current, category/tasks/future, /category/tasks/past. I can figure out how to get the query to work, I just am not sure how to pick up the type of filter from the URL. (currently it goes to a page not found error when adding the additional word after /tasks)

  • How are you getting a page under a category structure? What is category/tasks, a page? ... How are you doing that, i'd expect that to be a category archive.. Some clarification of how you're archieving the current setup would be helpful.. Please.. :)
    – t31os
    Feb 4 '11 at 23:35

If I'm understand the question right.... first login to the admin section. then click on "categories" its in the "Posts" accordion box. When your there you'll see all your categories. Next, following your example, you need to make "current", "future", and "past" all children of "tasks". this should achieve the desired URL. Let me know if I can help any more.


While my first suggestion would also be to go with hierarchical categories, from how your question is worded it seems closer to URL endpoints. Please note that it is functionality I heard to be messy and unreliable. :)

See add_rewrite_endpoint() in Codex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.