📜  从特定模板获取所有页面列表 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:35.835000             🧑  作者: Mango

代码示例1
$args = array(
    'post_type' => 'page',
    'posts_per_page' => -1,
    'meta_query' => array(
        array(
            'key' => '_wp_page_template',
            'value' => 'page_list_R_ea_modelling_instructor_led.php' // Template file name
        )
    )
);
$the_pages = new WP_Query( $args );

echo "
";print_r($the_pages->posts);exit;