Rev | Line | |
---|
[44] | 1 | ## pages/
|
---|
| 2 |
|
---|
| 3 | WP doesn't support page templates in nested folders like this one, so page organization isn't as clean as we'd like.
|
---|
| 4 |
|
---|
| 5 | Create a page in the theme root:
|
---|
| 6 |
|
---|
| 7 | File name: page-example.php
|
---|
| 8 |
|
---|
| 9 | **Note:** We recommend prefixing all of your page files with 'page-' so that they are easily sorted together in your theme directory.
|
---|
| 10 |
|
---|
| 11 | File contents:
|
---|
| 12 |
|
---|
| 13 | <?php
|
---|
| 14 |
|
---|
| 15 | /*
|
---|
| 16 | Template Name: Example Template
|
---|
| 17 | */
|
---|
| 18 |
|
---|
| 19 | if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
|
---|
| 20 | if (CFCT_DEBUG) { cfct_banner(__FILE__); }
|
---|
| 21 |
|
---|
| 22 | cfct_page('example');
|
---|
| 23 |
|
---|
| 24 | ?>
|
---|
| 25 |
|
---|
| 26 | This will then load 'example.php' from the _pages/_ directory, keeping all of your actual page code nicely organized in one spot.
|
---|
| 27 |
|
---|
| 28 | You can also add your page code to the page-example.php file you create in the theme root, but we're hoping to get support for pages in a sub-directory in a future version of WordPress so we are starting with what we consider to be a "proper" organization structure now.
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | ### Supported Filenames
|
---|
| 32 |
|
---|
| 33 | - pages-default.php (or default.php)
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | ### File Descriptions
|
---|
| 37 |
|
---|
| 38 | A "default" template is required. You can create other templates as desired.
|
---|
| 39 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.