title();
//Include the parent page if chosen
if( $asm->include_parent() ){
echo '
';
wp_list_categories( 'title_li=&include=' . $top_cat);
}
//If there are children to display
if( !empty($all_categories) ){
echo '
';
#-- If they want all the child categories displayed always
if( $asm->display_all() ){
wp_list_categories('title_li=&child_of=' . $top_cat .'&depth=' .$instance['levels'] );
echo '
';
} else {
#-- to Display the categories based a parent child relationship
foreach( $all_categories as $child_cat ){
//IF this is a child category of the top one
if( $asm->first_level_category( $child_cat ) ){
//List the child category and the children if it is the current one
wp_list_categories('title_li=&include=' . $child_cat->cat_ID . '&depth=1' );
//If there are children of this cat and it is a parent or child or the current cat
if( $asm->second_level_cat( $child_cat ) ){
#-- Create a new menu with all the children under it
echo '
';
} //End if display all is not checked
} //End if the are child categories
#-- if a parent category was displayed
if( $asm->include_parent() ){
echo '';
}