check all page names with tempalte

Solutions on MaxInterview for check all page names with tempalte by the best coders in the world

showing results for - "check all page names with tempalte"
Neele
04 May 2017
1global $wpdb;
2
3$sql = "SELECT post_title, meta_value
4  FROM $wpdb->posts a
5  JOIN $wpdb->postmeta b ON a.ID = b.post_id
6  WHERE a.post_type = 'page'
7  AND a.post_status = 'publish'
8  AND b.meta_key = '_wp_page_template'
9        ";
10
11$pages = $wpdb->get_results($sql);
12
13echo '<pre>';
14print_r($pages);
15echo '</pre>';