I'm creating my own wordpress theme. I've decided to use a different way to handle the theming and not use the standard get_header() and so functions.
What i do is have a general main.php page that is loaded by every page like blog.php, index.php, page.php and more. This main page, will be then responsible for creating the necessary templates and presenting the related page.
Now, i would ideally want to create sort of like the standard switch that includes files, like :
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 'home';
switch($page)
{
case 'home': break;
case 'mail': break;
case 'contact': break;
default:
$page = 'home';
}
include("$page.php");
How can i do such a thing for wordpress ? Is there a clean way to know whether an included page is a blog.php, a single.php or other page, so that i can distinguish them?