这对我来说很有效。但我很想听到关于更好的方法的反馈。谢谢
// Get all pages
$my_pages = get_pages();
// Get ID\'s of pages with "string" in title
foreach ($my_pages as $my_page) {
if ( stristr($my_page->post_title, \'string\') ) {
$include_ids .= $my_page->ID . \',\';
}
}
// Output only pages with "string" in the title
$args = array(
\'include\' => $include_ids,
);
wp_list_pages( $args );