[wp-hackers] using different templates for pages

Ryan Boren ryan at boren.nu
Tue Oct 26 21:39:56 UTC 2004


On Tue, 2004-10-26 at 20:58 +0100, Podz wrote:
> C. Rummel wrote:
> > I just copied index.php and strippped it off the comments/trackback-stuff.
> > 
> Thanks - got it working now.
> 
> > Well, thats the downside of using the nightlies... ;-)
> 
> No downsides, merely a voyage of discovery, with me making a lot of 
> notes as I go !

http://wordpress.org/pipermail/hackers_wordpress.org/2004-
October/002117.html

Page Templates must have a "Template Name:" field in the header.

Here's how WP decides which template to load for a page.

If a page template is specified, that template is loaded, if it exists.

Otherwise, page.php is loaded, if it exists.

Otherwise, index.php is loaded.

The templates must be in the theme directory.  For the default theme,
the theme directory is wp-content.

For a half-assed explanation of how the templates are loaded, see:

http://boren.nu/archives/2004/10/16/templates-and-the-is-functions/

My port of Kubrick to 1.3 provides a good example of how all of this is
used:

http://boren.nu/archives/2004/10/10/kubrick-130-rc2/

Ryan





More information about the hackers mailing list