[wp-hackers] Themes support

Allan Mertner amwp at mertner.com
Tue Sep 14 16:57:54 UTC 2004


Hi Ryan,

> <>Theme authors are free to organize their templates however they want. I
> have other themes that use separate templates for categories, posts,
> pages, etc. and separate includes for the header, footer, and sidebar.
>
> A theme must have a complete template. If you're doing a stylesheet
> only theme, you can pick up the template from another theme, but the
> template must be complete.

I don't think this is a desirable way for it to work: we should not try 
to promote copying of code or files where it isn't necessary.  Also, if 
this is indeed how it is intended to work, then the admin themes code is 
incorrect since it allows "partial" templates to be recognized and 
used.  The way the code currently works, the only required file is the 
stylesheet that needs to contain a few comments describing the theme.

Either way, code needs to be updated.  I would opt for updating the 
default files (index, wp_footer, wp_header, etc) to make them theme 
aware so they first look for the relevant file for the theme and if it 
doesn't exist then uses the default one.

> <>
>
>Don't use ABSPATH.  Make them relative.  I have the current default
>template (index + header + footer + sidebar) and stylesheet working as a
>theme just fine.
>  
>
The default files *do* use ABSPATH though.  This is one of the key 
things I think should change.

>We could ship it like this if we also shipped a default theme in the
>themes dir.  Wouldn't that surprise people?  What the hell happened to
>my index? ;-)
>  
>
I actually think it would be a good idea to include a default theme in 
the themes directory.  It adds overhead and complexity to the code to 
cater for the default non-standard template.

It also seems to me that Wordpress now caters for two different types of 
customization, and that only one is required.  If Themes support is 
completed, then I don't see a need to also be able to override 
wp_footer.php with footer.php (same for the other files). It just adds 
complexity that will confuse users and make the code larger: I would 
vote for a single extension mechanism that works well instead.

>I've moved my site layouts into the themes directory and left index.php
>and wp-layout.css in their WordPress default forms.  This way upgrades
>of the WordPress code don't disturb my templates or stylesheets.  Since
>I never switch to the default theme, wp-layout.css is unused and
>index.php is simply there to load wp-blog-header so that the template
>redirect can be performed.
>  
>
If my theme updates just the sidebar, then I would *welcome* the rest of 
the system being updated when a new change is made to the default 
index.php.  If I have made copies of all the files in order to make the 
theme work, then I have to remember to re-copy the same files again...

Does anyone else have views on this?

Allan




More information about the hackers mailing list