Theme folder needs cleaning, right?

Published: On Friday, July 20, 2007

Today I want to say a few words about the files located in typical theme folder. Before all I think that after opening this folder, you will see just a mess, mass of non-ordered files, the pile of randomly sorted files. The more often I work in template folder (what's actually almost always if I work with WP), the more I don't like this view.

What's the wrong way here?

Let's see my common view into default template folder (on Windows XP). Files are sorted alphabetically, ok, I can manually change order into „by type“, so the lucidity will increase a bit, but – nobody had thought about this?

Wordpress default theme folder

The problem is based in fact, that template folder is a composition of many files that are of many types and serve many purposes. If I speak about types, firstly I can mean different filename extensions…

  • .php files
  • .css files
  • else files

…but rather than that I mean different purposes of (php) files. See what I see:

  • page types and Page templates (contain the middle pieces from whole HTML page code)
    • index
    • page
    • single
    • etc.
  • code pieces
    • header
    • footer
    • sidebar
    • searchbox
    • etc.

I think it would be great to make order in these (all) files, so that the lightning look into the folder would give a man the plain answer where to find the file he wants. What we do if we (at least me) search a file now, is eye-browsing in ab-sorted folder and this of course can't be called as quick and intuitive orientation among files.

Wordpress administration file browser

Or look at the file-list in WP Administration → PresentationTheme Editor. And my orientation is on this screen probably even more complicated than yours – because half of time I work with localized (Czech) version, where the order differs again… But by the way, WordPress administration has a powerful ability to sort files as it wish. While browsing files with external application, which of course can't understand real meaning of files in theme folder, you must work with list of files sorted by name, type, date, etc., what can't help us evidently.

So how to fly out off mess?

What we should do, is grouping files of the same purpose. Let the single be with page and by the same way, put we (for example) the links with archives together.

New sub-folders? I don't like this idea. Sub-folder would separate files into meaningful groups, but you would need one more click (what can be a lot) and the navigation if folders structure would become more complicated.

Much more I like the second idea – file prefixes. (Look at the image below please…) Surely, it's not perfect, but you can see the idea. Even if you sort files by name (, what is AFAIK default state in Windows (other platforms?)), you will see files in groups. All files like before in one view (sub-folders would remove this possibility), but grouped, page types with page types, styles with styles, siblings side by side. This is what I wish.

Wordpress default theme folder after suggested changes

This image, this is only an example, raw suggestion, my idea's basic principle. Surely, order can be done better, surely the problem can be solved totally another way. Comments are open, your opinions welcome.


Comments are closed.

I quit working with WordPress, comments are closed. My plugins will not be updated any more – at least not by me. Feel free to modify my source codes though… Also I am not able to provide support, sorry. –Kahi