I try to add link to parent page to a working list of childpages. The parent page must be the first item's list whenever the list appear.
Here is the actual code found here :
//* List child pages [jla_childpages]
function jla_list_child_pages() {
global $post;
if ( is_page() && $post->post_parent )
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );
else
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );
if ( $childpages ) {
$string = '<ul id="childpages-menu">' . $childpages . '</ul>';
}
return $string;
}
add_shortcode('jla_childpages', 'jla_list_child_pages');
Anyone has an idea how I can transform this to add parent page to be the list first item whenever the list is shown ? Thanks !