Tag Info

New answers tagged

1

This will get you the post data for all child pages: $args = array( 'post_type' => 'page', 'post_parent__not_in' => array(0), 'no_found_rows' => true, ); $child = new WP_Query($args); var_dump(wp_list_pluck($child->posts,'post_title')); // debugging only Then pass the IDs to ...


0

Try using the following code to generate the child pages. <?php // Set up the objects needed $my_wp_query = new WP_Query(); // Query all pages $all_wp_pages = $my_wp_query->query(array('post_type' => 'page')); $page_ids = get_all_page_ids(); $page_children = get_page_children( $page_ids, $all_wp_pages ); echo '<li>' . print_r( ...


0

If you're really just looking to get a list of children with wp_list_pages(), then you should use the child_of parameter to do so. But I'm assuming you're actually want to restrict that list to a certain time frame, for this wp_list_pages(), which uses get_pages(), isn't really good equipped. So I'm thinking you should use get_posts() - or even WP_Query ...



Top 50 recent answers are included