The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Function get_page_children not working (2 posts)

  1. lastninja
    Posted 2 years ago #

    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
    Posted 2 years ago #

    No ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic