Question

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)

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top