Try understand how adding my own template pages:
- city.php
- province.php
-..
For testing add a new php-file in the active theme ../php dir:
city.php
In the dashboard, add new content and adding a template-name: city in the options-tab (se screenshot).
Adding this code in index.php (and temporary remove the old code):
Code: Select all
switch ($WHERE_AM_I) {
case 'page':
if ($page->template()) {
include(THEME_DIR_PHP.$page->template().'.php');
} elseif($page->categoryTemplate()){
include(THEME_DIR_PHP.$page->categoryTemplate().'.php');
} else {
include(THEME_DIR_PHP.'page.php');
}
break;
default:
include(THEME_DIR_PHP.'home.php');
break;
}
But it doesn't work. Searching this forum, Github, but can't find a (small) and clear tutorial how using my own page-templates (not only 'home' and 'page').
Hope someone can give me a hint or help with this?