Thank you for the link! I’m testing the following code, but my page is still showing ALL pages of the site-map, instead of the child pages. Do you any have ideas?
/* ===== set up what to get (tags, categories, etc...) ===== */
if($taxonomy){
$tags = get_terms($taxonomy, 'order=ASC&hide_empty='.$show_empty.'');
} elseif($show_categories == "yes"){
if($child_of != ""){
$childof = array();
$childof = preg_replace('/\s+/', '', explode(',',$child_of));
$tags = array();
foreach($childof as $kids){
$args = array(
'child_of' => $kids,
'order' => 'ASC'
);
$childcats = get_categories($args);
$tags = array_merge($tags, $childcats);
}
} else {
$tags = get_categories('order=ASC&hide_empty='.$show_empty.'');
}
} elseif($show_pages == "yes"){
if($child_of != ""){
$childof = array();
$childof = preg_replace('/\s+/', '', explode(',',$child_of));
$tags = array();
foreach($childof as $kids){
$args = array(
'child_of' => $kids,
'order' => 'ASC'
);
$childcats = get_pages($args);
$tags = array_merge($tags, $childcats);
}
} else {
$tags = get_pages('sort_order=ASC&hide_empty='.$show_empty.'');
}
} elseif($from_category){
$tags = array();
$posts_array = get_posts('category='.$from_category.'&numberposts=-1');
foreach($posts_array as $pa) {
$tags = array_merge($tags, wp_get_post_tags($pa->ID));
}
$tmp = array();
foreach($tags as $k => $v){
$tmp[$k] = $v->term_id;
}
$tmp = array_unique($tmp);
foreach($tags as $k => $v){
if (!array_key_exists($k, $tmp)){
unset($tags[$k]);
}
}
} else {
$tags = get_terms('post_tag', 'order=ASC&hide_empty='.$show_empty.'');
}