Theme folder needs cleaning, now!
Group styles together
If you need to have more than only one file with CSS code, it's proper to store these files beside each other. For example I usually need three CSS files: standard visual, visual for IE6 (linked in HTML via conditional comments) and one for printers.
- style.css
- style.ie.css
- style.print.css
Even if I don't sort theme folder anyway, what means files are sorted alphabetically, these guys are always together.
This same principle (adding identical prefix to all files in group) we can apply in more cases.
Grouping some code blocks
Except page templates, where filename doesn't ever matter, we are able to group some another code-blocks together.
- header
- footer
- sidebar(s)
- search-form
- (…)
(I will call these file bordering code blocks because I can't come up with anything better now.)
But it must be remembered, that after changing default names of bordering
code blocks the default functions for
including these files stop working as well. get_header() will not
include our renamed header anymore. At this moment, if WordPress won't find
default.php in active-theme-folder, it will try to load header from
default-theme folder. If we want to use renamed bordering code blocks,
we must stop using functions…
get_headerget_footerget_sidebar
… and start using the same syntax as is the search-form by default loaded:
include (TEMPLATEPATH . '/search-form.php');
One more thing should be remembered: if you want to add comments-block file
to the previous group, you must change the calling of the
comments_template() function to:
comments_template('/comments-renamed.php');
But it's unfortunately all, what we can do. All the files from
404.php to single.php must stay how they are so doing
the last step in tiding-up procedure is impossible. Now ours theme's folder can
look like this:

Comments
No comments yet.
Add a comment