• Resolved sellemo

    (@sellemo)


    Hello.
    I’am looking for a function, that returns the informatiob whether a giving category has sub-categories.
    Does this already exist?
    And if not how can I create it?
    Thanx.
    sellemo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    It’s not exactly documented anywhere, but get_category_children($id, $before, $after) will return a list of children id’s for a given category.

    This code will tell you if you have children in a category, I think:
    $children = get_category_children($id,'','');
    if ($children == '')
    {
    // no children
    } else
    {
    // has children
    }

    Thread Starter sellemo

    (@sellemo)

    thanx. works fine. exactly that I was looking for.
    sellemo.

    Thread Starter sellemo

    (@sellemo)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘looking for a function: sub-categories in a category exist?’ is closed to new replies.