Restricting or customizing posts (dynamically?) in category template
-
I have the following categorical structure (simplified here):
- Topics
- Interdisciplinarity
- Globalism
- Emotion
- Roles
- Speaker
- Moderator
- Writer
- Overview
I would like to make category-topics.php (the template for viewing any of the Topics subcategories specifically), such that I can display the posts differentially based on what other categories they belong to.
So think of the following 3 posts in terms of the categories assigned to them:
- Post 1: Interdisciplinarity (topic) + Overview
- Post 2: Interdisciplinarity (topic) + Speaker (role)
- Post 3: Interdisciplinarity (topic) + Moderator (role)
I’d like those posts that also belong to Roles (#2 & 3) to display in one way in the left column (titles only), and those posts that also belong to Overview (#1) to display in another way in the central column (post content included).
I am trying to do this with two loops, using Rewind. I found how to restrict the posts the loop spits out by excluding certain categories (-3,-11), but when I go about doing that, the category view ceases to function as a category view and begins displaying all posts I don’t explicitly exclude. That’s the problem. I want to keep the category template’s restriction to the category the user selected, but modify what happens within that. Am I being clear?
I am trying to make a special view for Topics, so I don’t need a template page for all of its sub-categories.
It seems the problem could be solved by being able to specify including the “current” (clicked) category, and from there excluding posts that also belong to other categories (Roles).
Sorry, my terminology is definitely off. I do not know PHP. I am muddling through the documentation here, but what I’m looking for really doesn’t seem to be covered. I am kind of treating the category template as a page design, so that the elements it uses to display are still unique posts that can be reshuffled for other views. Pretty much what WordPress is for, but again, I’m not finding this answer…
Any help would be greatly appreciated! I haven’t tried this forum before.
- The topic ‘Restricting or customizing posts (dynamically?) in category template’ is closed to new replies.