[wp-hackers] Theme structure

Stephen Rider wp-hackers at striderweb.com
Wed Jun 11 17:45:36 GMT 2008


I would start by learning add_action(), add_filter, do_action(),
apply_filter() like the back of your hand.

These would be a very good way of having themes that allow users to insert
custom stuff into specific parts of the theme without actually editing the
theme files.

Good luck with this, I think it's an interesting idea. :)

Oh, you might also want to base your design off of something like the
Sandbox theme.

Stephen

On Wed, 11 Jun 2008 10:19:58 -0700 (PDT),  wrote:
> I'm working on building an interactive theme editor.  The idea is that
the
> editor would enable definition of various layouts, and support styling. 
> The goal is to enable relative novices to design their own theme, then if
> they find cool stuff somewhere and put it in with a text editor, then the
> theme editor will still be able to work with the modified files. 
> Obviously, not every change can be accommodated, but I'm thinking to
cover
> certain "normal" changes.
> 
> At this point, I'm just working out the concept.
> 
> First though, I want to understand better the structure and conventions
of
> a theme.  Obviously, WP generates HTML files using PHP, but in general
> people could do all kinds of wacky things in PHP.  I was wondering if
there
> are solid standards about how a page comes together.  For example, are
> functions usually expected to create balanced HTML, or is it common to
> produce unbalanced code that must be closed off by another function?  For
> example, get_header() generates HTML which is incomplete without calling
> get_footer().    In cases like this, I could just pair off the two
> elements, and allow arbitrary stuff to be added between..
> 
> How much can a not-totally-stupid editor attempt to understand the
> structure of a document?  What are the gotchas to watch out for?




More information about the wp-hackers mailing list