title();
$content = '';
#-- list the parent page if chosen
if( $asm->include_parent() ){
$content .= '
';
$content .= $asm->openListItem(wp_list_pages("post_type=".$post_type."&sort_column=$order_by&title_li=&echo=0&depth=1&include=".$top_parent) );
}
//If there are children start the Child Sidebar Menu
if( $child_pages ){
$content .= '
';
#-- If they want all the pages displayed always
if( $asm->display_all() ){
$content .= wp_list_pages("post_type=".$post_type."&sort_column=$order_by&title_li=&echo=0&child_of=".$top_parent."&depth=".$instance['levels']."&exclude=".implode(',',$asm->exclude) );
} else {
#-- Display children of current page's parent only
foreach($child_pages as $pID){
#-- If the page is not in the excluded ones
if( $asm->exclude( $pID->ID) ){
#--echo the current page from the $result
$content .= $asm->openListItem(wp_list_pages("post_type=".$post_type."&sort_column=$order_by&title_li=&echo=0&depth=1&include=".$pID->ID));
} else {
continue;
}
$content .= $asm->displayGrandChildMenu($pID);
$content .= '';
}
}
#-- Close the First Level menu
$content .= '