WordPress.org

Ready to get started?Download WordPress

Forums

Function get_page_children not working (2 posts)

  1. lastninja
    Member
    Posted 9 months ago #

    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?

  2. lastninja
    Member
    Posted 9 months ago #

    No ideas?

Reply

You must log in to post.

About this Topic