• Hello!

    As you can see on my current project website, Gaming World, topmost parent categories appear in tab form inside a black bar above the content area.

    What I’d like to know is how to list all of the categories related to these tabs in the sidebar, meaning that if you click on one of the tabs or its subcategories or posts, all of the categories that fall under the tab should show up in the side bar.

    For instance, in a setup that looks like this:

    [Games (top level tab)]
      |_ Level 1
        |_ Level 2
          |_ Post
        |_ Level 2
    
    [Applications (top level tab)]
      |_ Post
      |_ Level 1
      |_ Level 1
        |_ Post

    All of the categories that fall under either Games or Applications should be listed in the sidebar if you click on any of the posts or categories under either category.

    I’ve Googled this like a nut without finding anything, and I won’t be able to launch the site until I get this function down.

    ANY help would be appreciated.

    Thanks. ??

Viewing 16 replies (of 16 total)
  • i find this question interesting.

    I’m thinking one should use the wordpress function get_category_parents(). it returns a string that is a list of category parents of the current category. the list appears to start with the top-most category and end with the bottom-most (the immediate parent of the current category)…though I could have it backwards.

    You can choose how to have it separated…a comma would probably be good. leave nicenames set to false (don’t set it to true as it defaults to false), that way i guess you get category id numbers. then you can split the string on the separator and voila, you’ve got all the cat IDs from top to bottom (you can get the nice names later via the ID).

    Alternately, you could turn nicenames on make sure you use a separator symbol that will NOT be in any of your category names so that the split only splits on the separators and not in the middle of any cat’s name.

Viewing 16 replies (of 16 total)
  • The topic ‘Complex category function – Relative conditions’ is closed to new replies.