[wp-hackers] Themes support

Jamie Talbot wphackers at jamietalbot.com
Wed Sep 15 10:53:21 UTC 2004


Hi,

Just to add to this, I managed to kind of break the theme manager in the CVS as
of yesterday.

I installed and activated the Kubrick theme.  All good, looked lovely.  Then I
deleted the Kubrick folder without deactivating it.  That's the kind of thing
my mum would do.  When I viewed the site, of course it was unstyled because the
CSS no longer existed.  However, going back to the Presentation Manager, I found
that there was no option to turn back on the default styling, even though it
told me that the default theme was active.  I had to reinstall Kubrick for the
option to change back to the default style to appear.

In short, deleting the last theme while it is still active makes the blog
unstylable until another theme is installed.  I would recommend checking for
the existence of the active stylesheet when the theme manager is loaded, and
bailing to the default if it isn't there.  I guess this kind of happens in the
Plugins manager when an activated plugin is deleted?

Checking for the existence of the loaded CSS as index.php is executed might also
be a good or bad idea, depending on time load concerns etc...

Love the idea of a theme manager, keep up the good work!

Cheers,

Jamie.

--
http://www.jamietalbot.com


Quoting Allan Mertner <amwp at mertner.com>:

> 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
>
>
> _______________________________________________
> hackers mailing list
> hackers at wordpress.org
> http://wordpress.org/mailman/listinfo/hackers_wordpress.org
>




More information about the hackers mailing list