Display Sub-categories apart from their parents (4 posts)

  1. msharif1188
    Posted 4 years ago #

    I'm looking for a way to display the sub-categories apart from their parents, somewhere else in sidebar.

    an image of what I mean.

    really appreciating your help, in advance.


  2. WebTechGlobal
    Posted 4 years ago #

    First approach that came to my mind was looping through all categories and having a condition that excludes parent categories from being displayed.

    Could easily query the term and taxonomy table to see if each category is a parent or not and display accordingly.

    Lets not rule out get_categories though, although that only looks like you can get child categories for a single giving parent category.

  3. msharif1188
    Posted 4 years ago #

    thanks for help
    I'm not good at scripting. Would you please help me finding the best codes needed here?

  4. WebTechGlobal
    Posted 4 years ago #

    Wish I could but I'm super busy, I'm a developer myself. Deep in a hired project right now. Try with me again in a few days if your still stuck, can even get me on the WebTechGlobal site

    Someone has to have done this before. Keep Googling. As I said the get_categories function just might allow it already. It allows you to state what level of categories you want to retrieve, but not sure if it returns the first level always or if you can exclude the first level (parents).

Topic Closed

This topic has been closed to new replies.

About this Topic