';
echo '
';
if ( is_page() && $post->post_parent && !$parent ){
$childpages = get_pages( array( 'child_of' => $post->post_parent, 'sort_column' => 'menu_order' ) );
} else {
$post_id = $post->ID;
if($parent) {
if(!is_numeric($parent)){
$id = get_page_by_path( $parent );
$parent = $id->ID;
}
$post_id = $parent;
}
$childpages = get_pages( array( 'child_of' => $post_id, 'sort_column' => 'menu_order' ) );
if(!$childpages) echo 'Sorry, no pages was found
';
}
foreach ( $childpages as $page ) {
$classes = '';
if($page->ID == $current) $classes = 'active';
echo '- '.$page->post_title.'
';
}
echo '
';
echo '
';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
add_shortcode("ux_nav", "ux_navigation");