[wp-hackers] Parent-Child Themes and New Page Templates

Ian Stewart ian at themeshaper.com
Mon Jun 2 16:45:26 GMT 2008


PROBLEM: I can make new, CSS-only, child themes by including "TEMPLATE:
define-parent-theme-here" in the comments of my stylesheet, inheriting all
the page templates of a parent theme. I can override and add new functions
by including a functions.php file with this child theme. BUT! What if I want
to add new page templates? Can I add foo.php or bar.php in the folder of my
child theme and make it available in WRITE > PAGE?

EXAMPLE:

sandbox
..header.php, sidebar.php, etc.
..links.php
..archives.php
[links and archives are existing custom template files]

child-theme
..style.css
..functions.php
..foo.php
..bar.php
[foo and bar are new page templates that should become available when child
theme is the active theme—but they currently don't]

BONUS: Why would I want to do this? More custom themes, less work.

A blog is a blog is a blog: most custom theming work happens on the home
page. Make a new home-page.php file in a child theme and with some fun CSS
and javascript you can make a host of easily maintained themes; most of the
code is recycled from the pristine "parent theme". Imagine a hundred clients
with drastically different sites, all with easily upgraded code: overwrite
the parent theme, tweak home-page.php. Done.

This should also add a lot more options and possibilities to the coming
WordPress Theme Marketplace, speeding up theme vetting (most of the code
being inherited from The Sandbox) while providing some even more
dramatically new variations.

Anyone know how to do this?

-- 
Ian Stewart
www.ThemeShaper.com


More information about the wp-hackers mailing list