• I have two related questions about the 6.0 category templates. Is there a way to create one category template that fits all categories? For instance, each of my categories include a slightly different path used in various links within that category. (For instance, one category may include links to MyCat/xxx/xxx). Another may include AnotherCat/xxx/yyy.) Is there anyway in the Query Link block to inherit the paths?

    If that’s not possible, will a WordPress version include the ability to create a folder in the templates area that can be used to store a number of different category templates? (Instead of hundreds of category template files flooding the templates area, a folder could collect all category templates?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Are you talking about contribution categories? Or are you talking about an individual taxonomy with which you map these categories?

    I assume with the structure of the paths you are referring to categories that lie within each other? So main category A with subcategories A1 and A2 and so on.

    For an answer to your question, it is also important to know, especially with WordPress 6.0, whether you use a block theme or a classic theme? For classic themes, you can use one template per taxonomy to display all entries for the taxonomy. And about a 2nd template all detail views of the taxonomy.

    Thread Starter Ed Sutherland

    (@upstateny)

    Le me try to be more specific. I’m using a child theme of Blockbase. My main template shares the majority of layout with all categories.

    The sticking point is a secondary menu used throughout all templates which has the same text and order (‘Legislature’) and the majority of the category paths the same. The only difference is the child category that specifies the final destination. For instance, one category may have this path: /firstcat/secondcat/legislature1Cat. A second path might be /firstcat/secondcat/legislature2Cat. The variable is legislation[x]Cat.

    The question becomes how to use one template part that covers numerous category path variables. Otherwise, I’ll need to create template parts for each different menu path.

    One potential solution might be to use the same slug for the last child menu path. For instance, all menus would point to /firstcat/secondcat/legislature. The problem is that WordPress doesn’t permit the same category slug being used as several child categories. (one child category could not be named ‘legislature’ and another child category be named ‘legislature’.)

    • This reply was modified 2 years, 5 months ago by Ed Sutherland.
    Thread Starter Ed Sutherland

    (@upstateny)

    I came upon a partial solution that could reduce the headaches over categories. I found I could substitute pages for the categories, allowing slugs with the same name (like “legislature”) can be used multiple times.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category template improvements?’ is closed to new replies.