To obtain a list of pages you can use wp_list_pages
. In addition to this you can also specify the page ID and the amount of levels of sub-pages that you want to retrieve but using child_of
and depth
.
1 2 3 4 5 6 7 8 9 |
<!--?php require('wp-blog-header.php'); define('WP_USE_THEMES', false); $children = wp_list_pages('title_li=&child_of=942&echo=1&depth=0'); if ($children) { print_r($children); } ?--> |