Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get all pages list from specific template

$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 "<pre>";print_r($the_pages->posts);exit;
 
PREVIOUS NEXT
Tagged: #pages #list #specific #template
ADD COMMENT
Topic
Name
8+8 =