get_page_templates(); ?>

List of custom template files in a theme.

$template_filename) { $pages = get_pages(array( 'meta_key' => '_wp_page_template', 'meta_value' => $template_name )); ?>
0){ echo ", "; } if ($page->post_title != '') { echo esc_html($page->post_title); } else { echo "-"; } $i++; } ?>
30) ? substr($text, 0, 30) : $text; // Conversion method. $cleantext = strtolower(trim(preg_replace('#\W+#', '_', $text), '_')); $current_theme = wp_get_theme(); $theme_path = get_theme_root() . "/" . $current_theme->stylesheet; $template_file = $theme_path . "/" . $cleantext . ".php"; // Content for template file Start $content = "