Weddings All Weddings Meetings Special Events function wpb_list_child_pages() { 02 03 global $post; 04 05 if ( is_page() && $post->post_parent ) 06 07 $childpages = wp_list_pages( ‘sort_column=menu_order&title_li=&child_of=’ . $post->post_parent . ‘&echo=0’ ); 08 else 09 $childpages = wp_list_pages( ‘sort_column=menu_order&title_li=&child_of=’ . $post->ID . ‘&echo=0’ ); 10 11 if ( $childpages ) { 12 13 $string = ‘ ‘ . $childpages . ‘ ‘; 14 } 15 16 return $string; 17 18 } 19 20 add_shortcode(‘wpb_childpages’, ‘wpb_list_child_pages’); All Weddings Meetings Special Events Share Back to top