[wp-hackers] Theme File Structure

Dobri dyordan1 at ramapo.edu
Wed Mar 27 18:25:12 UTC 2013


Hey guys,

Thought I could borrow your brain for something:

I'm working on a theme that is very specialized and very complicated. The more I add to it, the more of a hell it becomes to manage. My current strategy is to have individual folders for sections of functionality and in each folder have a main file that includes pretty much everything in that folder with some comments as to what each include is responsible for. Then, all of those "organizer" files are included in my functions.php file. Other than that, in the root of the theme I have a couple of templates and the usual sidebar/header/footer/style/index/etc. I also have a resources folder that contains extra css, js files and images/icons/etc. each type in a subfolder. Lastly, I have a utility folder that is not used by WordPress but is theme-related functionality that is used by automated scripting on the server. Is this a good file structure for the theme? It seems that all the folders are just a bunch of layers of nothing since everything ends up being included in the functions.php file anyway. Is there a better approach to organizing all of the code?

TL;DR: What is a good way to organize files in a complicated theme?

Thanks!

~Dobri



More information about the wp-hackers mailing list