[wp-hackers] get_categories() question

Scott Bressler sbressler at gmail.com
Thu Aug 5 06:51:27 UTC 2010


Would happily use this, but was wondering if there was a built-in function I
could use rather than writing my own SQL.

http://wordpress.org/support/topic/list-of-top-levelroot-categories

On Wed, Aug 4, 2010 at 11:35 PM, Scott Bressler <sbressler at gmail.com> wrote:

> This should be really easy, but I can't figure it out. I'm trying to use
> get_categories to list all the top-level categories of a blog.
> wp_list_categories, which calls get_categories, allows for a 'depth'
> parameter, and it functions as expected. However, get_categories seemingly
> doesn't allow for this same parameter. Is there a way to use get_categories
> to only get the top-level categories? What about if I wanted to get the
> top-level terms of any taxonomy?
>
> Thanks,
> Scott
>


More information about the wp-hackers mailing list