Find Any Theme’s page.php File

Further contemplation, and looking at the template hierarchy, lets me know that every theme needs at least a page.php, or singular.php, or the index.php file is used.

So, I just need to figure out the current theme directory (via get_theme_directory function), and see if the page.php file exists. If so, use the code from that template as the basis for the new template.

If it doesn’t exist, then look for and use singular.php and index.php in that order.

And if that doesn’t exist, the theme has problems, and probably wouldn’t work correctly.

So, there is no need to figure out what template a theme will use for a page. They will have a page.php (or a page-something.php, which I can look for).