Hi I am searching to acquire all of the (parent) groups using their children accordingly (presuming you do not have grandchildren) making the next structure

  <div class="box">
    <h3><a href="#">Parent Category I</a></h3>
    <ul>
      <li><a href="#">sub cat 1</a></li>
      <li><a href="#">sub cat 2</a></li>
      <li><a href="#">sub cat 3</a></li>
    </ul>
  </div>
  <div class="box">
    <h3><a href="#">Parent Category II</a></h3>
    <ul>
      <li><a href="#">sub cat 1</a></li>
      <li><a href="#">sub cat 2<</a></li>
      <li><a href="#">sub cat 3</a></li>
    </ul>
  </div>

I believed it is something like (don't mind the syntax) however I'm not sure how you can obtain individuals (parent)groups as well as their children:

$parents = ... ;

foreach($parents as $parent){
<div>
<h3>$parent</h3>

$children = ...;
<ul>
foreach ($children as $child){
<li>$child</li>
}
</ul>

</div>

}

I'd begin with get_categories() and wp_list_categories() (the function, while it might not work best with your requirements, is extremely flexible), and reckon that you'd need to use a for-loop to undergo parents groups having a nested loop to handle children (as the pseudo-code indicates). Particularly with wp_list_categories(), you most likely will not have the ability to obtain the exact structure you would like, but a minimum of something which you'll have the ability to style reasonably.

as what benny published, wordpress_list_groups could be your very best function to make use of.

Possibly you need to re-think the html structure because the way wordpress formats your category list is within an unordered list, this really is to ensure that in case your styling does not load it's presented inside a natural format. Nevertheless, you can transform this behavior by altering the need for 'hierarchical' to false.

Hope this can help :)

ok I believed it myself thanks anyway Benny &lifier Take advantage of

I basicly made 2 functions

function getParentCategories() {
    global $wpdb;
    $sql = "SELECT term_id as id, name, slug FROM wp_terms where term_id in (SELECT term_id FROM wp_term_taxonomy where parent = 0 and taxonomy = 'category') order by name asc";
    $parents = $wpdb->get_results( $sql );
    return $parents;
}

function getChildCategories($id) {
        global $wpdb;
        $sql = "SELECT term_id as id, name, slug FROM wp_terms where term_id in (SELECT term_id FROM wp_term_taxonomy where parent = $id and taxonomy = 'category')  order by name asc";
        $children = $wpdb->get_results( $sql );
        return $children;
    }