• Hi

    I am hoping someone might be able to suggest a more elegant approach. I feel like I am using a hammer to solve a problem.
    Lostwithiel
    I am using WordPress to power a directory listing for the above site. If you click on Food and Drink you will notice that the left hand sidebar links change to reflect that category id. I have created a category-??.php template for the category. I have also created a template for all sub-categories of that category along with single-cate-??.php for each single post.
    This approach has brought up two issues. Firstly, the amount of files. I currently have about forty cat files and about 35 single-cat files – it seems excessive and secondly, if a new category is created by a user I will have to create a new cat and single-cat file.
    Any ideas please?
    Thanks
    Rich

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Richard Brown

    (@cregy)

    Hi
    I think I should have added some additional information. I am using the child_of argument to list the sub categories for the main category. e.g. Food and Drink
    –Coffee Shop
    –Pub Food
    –Restaurants
    –Take Away
    –Tea Shops

    What I have found though is that when I click on say pub food, it won’t list all the sub categories of food and drink. What I was hoping was to be able to create a main category-??.php file for the food and drink category. When that was selected it would include all child categories. Is this possible please?

    Thanks

    Rich

    nykm

    (@nykm)

    The subject says “resolved” but there’s no answer here :/

    How do I apply category-#.php to all sub-categories as well?

    nykm

    (@nykm)

    bump? 🙁

    I think I have the same problem ….

    I need a page that can list the last 5 posts of 2 sub-categories of diferents parents. The problem is the sub-categories are choosen by user.

    Example:

    If I have the categories

    Vehicle
    - Car
    - Byclicle
    
    Colors
    - red
    - yellow

    and the user click in link to sub-category ‘bycicle’. In the url …./categoy/vehicle/bycicle the user click in link ‘red’. At this moment I need a page that can filter the last 5 posts in category ‘red’ AND ‘bycicle’ (in BOTH sub-categories)

    My ask: how can I do this page? I can use the category.php or create a new page for this? In this example, how can I do the last page send these two informations ( in a url or wp have a system to send vars to other page )

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Multiple Category and Single-Cat Templates’ is closed to new replies.