• I would like to be able to retreave the category list as an array and not as html output. The effect I’m after is to be able to, on the index page, have the top categories listed horizontaly with each categories sub categories underneath.

Viewing 3 replies - 1 through 3 (of 3 total)
  • get_the_category() is what you want.

    Let us know if you still have questions.

    No, I don’t think that’s actually what he wants. I want the same thing too. I want to be able to retrieve the list of categories as an array so that I can apply an ‘active’ class to the link if I am already in that category.

    What I need is the categories as an array. I would rather not have to run my own MySQL query but I think that’s what I’ll have to do.

    Why doesn’t the list_cats function call another function that returns an array of categories. Then it could apply all the HTML it wants. The rest of WordPress is so well coded, I was surprised to find this obvious shortcoming.

    Hey that yellow glow thing when you post is cool.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Retreave the category list as an array’ is closed to new replies.