Hi I'm looking to obtain all the (parent) categories with their children accordingly (assuming you don't have grandchildren) and make the following 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 figured it's something like (don't mind the syntax) however I don't know how to obtain those (parent)categories and their children:
$parents = ... ;
foreach($parents as $parent){
<div>
<h3>$parent</h3>
$children = ...;
<ul>
foreach ($children as $child){
<li>$child</li>
}
</ul>
</div>
}