Function get_page_children not working
-
Hello,
Im getting mad with get_page_children function!
I have 2 pages with one child for each. The function works only with the second one. The code is:<?php $all_wp_pages = new WP_Query(array('post_type' => 'page')); $child = get_page_children( $post->ID, $all_wp_pages ); ?> <div class="link-page aligncenter textcenter" style="padding-top:20px;"><a href="<?php echo get_permalink( $child[0]->ID ); ?>">.: Itinerario dettagliato :.</a></div>
The first page return an empty array for $child.
The parent ID for the first page’s child is correct!
Why this happen?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Function get_page_children not working’ is closed to new replies.