WordPress.org

Support

Support » WP-Advanced » how to get all child page in dropdown list of all parents page

how to get all child page in dropdown list of all parents page

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this…

    <?php
    $children = wp_list_pages(title_li=&child_of='.$post->ID.'&echo=0');
    
    if ($children)
    {
    ?>
       <ul>
    <?php
          echo $children;
    ?>
       </ul>
    <?php
    }
    ?>

    For more options with what is displayed search this site for wp_list_pages

    guymclaren

    @guymclaren

    Parse error: syntax error, unexpected ‘=’ in ……/wordpress/wp-content/themes/bacs/header.php on line 61

    Typo here

    $children = wp_list_pages(title_li=&child_of='.$post->ID.'&echo=0');

    should be

    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');

    Not the ‘ ( single quote )

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to get all child page in dropdown list of all parents page’ is closed to new replies.