Forums

List related categories to an aricle in sidebar (1 post)

  1. Etrimon
    Member
    Posted 1 year ago #

    Hallo people,

    I have this problem. I have 1 main cateogory, thi main category has from 6 subcategories and each subcategory has from 4 - 10 sub subcategories.

    Example:
    Food
    - Drinks
    -- Coffee
    -- Tea
    -- Water
    -- Coke
    - Meat
    -- Red meat
    -- Chicken
    -- Fish
    - Wine
    -- White wine
    -- Red wine
    -- Combined

    and so on.

    The archive.php is listing all articles from the Food category and I assigned to it sidebar-food, which displays only all depth=1 cateogories (Drinks, Meat, Whine). So far so good.

    Now I have for example an article Chicken with rise, that would be assigned to these categories: Drinks, Tea, Coke, Meat, Chicken, Wine, White wine (other articles assigned to different categories).

    Now I need one thing. After I click on an article, I would like that the sidebar changes to a list of cateogories, but only to those which are related to the clicked article.

    Is there a snippet how to do it?

    Thank you very much for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic