You should first understand that gecka submenu, can render a list of child items of menu items defined in a custom menu (under appearance > menu)
If you want to render the child pages of current page just use the wp_list_pages function.
Something like this could do the trick:
function gecka_subpages( $atts ) {
$defaults = array('title_li'=> '', 'child_of' => $GLOBALS['post']->ID);
$atts = shortcode_atts( $defaults, $atts );
$atts['echo'] = 0;
return wp_list_pages($atts);
}
add_shortcode( 'subpages', 'gecka_subpages' );
Then use the subpages
shortcode using any argument from wp_list_pages documentation page
—
Gecka
We helped you? Say thanks