Posts: 457
Name: Randy
Location: Northern Wisconsin
|
There are many tutorials on this, though, the simplest way is to:
1. copy your current page.php file and paste into a new file.
2. At the top of the new file add:
PHP Code:
<?php /* Template Name: Custom Page 1 */ ?>
3. Then you can just modify the code in this new file as needed.
To use the template, simply select it from the Page Template options list in the right column of the edit page area.
Some reminders:
1. This is only for Pages, not Posts.
2. Any number of pages can select this template.
3. Be careful not to title it similar to page-contact-me.php.(eg: preceding with "page-") Doing so will make WP look for a page in your database titled exactly "contact me".(or the slug)
Alternately, you "can" title the custom page the same as a page slug in the database as mentioned above. However, going this route, you will not need to add the template name in comments at the top. These types of templates will be assigned automatically to the matching page and NOT allow the options for other pages to use them.
Official resource:
http://codex.wordpress.org/Pages
There are also some non-native WP functions for finding a subpage at http://www.mattvarone.com/wordpress/...page-function/
Last edited by racer x; 01-29-2011 at 03:38 PM..
|