对我来说,这听起来像是一个很好的家庭自定义帖子类型的用例,但是,在任何情况下,这是您需要遵循的基本概念,以便在您现在已经设置好的情况下工作。
<?php
// Set up the objects needed
$homes_wp_query = new WP_Query();
$all_wp_pages = $homes_wp_query->query(array(\'post_type\' => \'page\', \'posts_per_page\' => \'-1\'));
// Get the page as an Object
$our_homes = get_page_by_title(\'Our Homes\');
// Filter through all pages and find Our Homes\' children
$home_children = get_page_children( $our_homes->ID, $all_wp_pages );
// echo what we get back from WP to the browser
echo \'<pre>\' . print_r( $home_children, true ) . \'</pre>\';
?>
这将打印post对象,然后您可以选择要回显的元素(如标题等)