How to filter posts in category by taxonomy term?
-
Hi!
I am not sure if this has been posted/resolved before–my Google-fu isn’t working on this one. This is probably because I can’t figure out the best way to phrase the search. Anyway, here is my problem:
I have a site I am rebuilding. It is my faculty site where I post my course materials: homework assignments, class announcements, tutorials, etc. for each class I am teaching (or have taught). At the moment, I have the ready-made WP post type (no custom post types), categories, and a few custom taxonomies. The categories describe the types of courseware posted (assignments, announcements, tutorials, etc.). One of the taxonomies is a hierarchical one called “course”. The terms in it are the course codes for the class I teach (or have taught). Terms for past classes are moved to be sub-terms (?) of a term called “Archives”. The other taxonomies aren’t relevant for this.
I have a menu that lists the categories (the types of courseware). The menu is used for each course. Right now, if a user clicks the link to one of the menu items (let’s say Assignments) the default action is to show a generic category.php template file that displays all of the posts for that category. So, for example, clicking Assignments will show all of the posts in the category assignments. What I want to have happen is to show only the posts in a given category that also have the course term. As an example, if I were on the home page looking at the course snapshot (shows latest post for a given course term that’s not archived) for course IMD100 and clicked the menu link for Assignments, I want to retrieve a list of all assignments for course term IMD100 only.
I hope this makes sense. I am figuring there is something to do with sending additional query vars or custom URL, but I am at a loss as to where to start and what to look for. Any help is greatly appreciated!
- The topic ‘How to filter posts in category by taxonomy term?’ is closed to new replies.