Add the following code to the functions.php file of your current activated theme or you can also add the below code inside your site-specific plugin.
1 2 3 4 5 6 7 8 9 10 11 | /** * Get a list of all custom page templates in WordPress. */ $themeObj = wp_get_theme(); $templates = $themeObj->get_page_templates(); echo "<ul>"; foreach ( $templates as $template_name => $template_filename ) { echo "<li>" . $template_name . "(" . $template_filename . ")</li>"; } echo "</ul>"; |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.