[theme-reviewers] Template hierarky

Otto otto at ottodestruct.com
Tue Feb 26 06:32:17 UTC 2013


The problem with that theme is that it doesn't use the Template
Hierarchy at all. Not really. All you've done is to take everything
that should be in the Template, move it into a named function
elsewhere, and then called it using either a direct call from the
actual Template or using a custom action hook.

Basically, this amounts to obfuscation and it makes the theme
difficult to understand and edit.

A theme should not only be fast, pretty, etc, but it should also be
easy to understand, modify, and use. By taking the normally easy to
understand hierarchy, and moving everything into one file (canvas.php,
and functions.php to some extent), you've made it far more difficult
to understand and modify.

This isn't to say that it is not possible to use your theme as the
basis for a child theme, it's just overly complicated to do so. What
you think is easy, a regular user will think is hard. Regular users
don't understand actions. Or functions. Or much PHP for that matter.
But file names they tend to already know. Copying files, copy pasting
sectons of simple HTML, this is within their grasp. Even editing HTML
and CSS to bend it to their will is quite simple.

It should not be necessary for a user to know PHP and WordPress
actions and filters to be able to find something in your theme and
modify it to their needs. The Template Hierarchy is intended to make
themes easier for end-users to understand. If they want to modify,
say, their single-post pages, then they can look for single.php and
modify them there. If the single.php doesn't exist, then they can look
in the index.php and either modify it there, or copy it to single.php
in their child theme and modify it there. How are they going to know
that they need to look in the inc/canvas.php file and modify it using
a child theme's functions.php file and also need to remove and add new
action hooks to accomplish their goals?

It's all well and good to firmly adhere to the principle of Don't
Repeat Yourself, but people repeat themselves all the time. They're
used to it. They know it. You can take the principle of
not-repeating-yourself too far very easily, and it's worth duplication
of code and HTML in order to achieve simplicity.

-Otto



On Tue, Feb 26, 2013 at 12:23 AM, hal-android <hasilent00 at gmail.com> wrote:
> Thanks emil for quick respon,
>
> My point is,
> Is it in need of templates complete with looping, while the parse of
> wordpress template like the one in charge here:
> http://codex.wordpress.org/Theme_Review # Theme_Template_Files
>
> We can make a part of another template if it is needed, while the
> canvas theme has do_actions method that calls the loop, without the
> need to include another file template.
>
> For the child theme I think it's easy. I have written here.
> http://amdhas.com/blog/do-action-hook-on-wordpress-theme
>
> We might know why genesis framework became very famous, because the
> view of the ease of making child theme add_action only, is when the
> user wants to create a child theme. Users do not need to include the
> entire file parent theme. Quite simply by remove_actions.
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers


More information about the theme-reviewers mailing list