While WordPress themes technically only require two files (
style.css), they usually are made up of many files and can become quickly disorganized.
In the last section, Template Files, you set up your
header.php, footer.php, page.php, home.php, and single.php files.
Let’s look at the Twenty Twelve theme default themes as one example of good file structure and organization. While this may be a bit overwhelming at first, let’s break it down. Can you find the templates you just built?
While there are still a lot of files, their names help provide a context of what they are. Basically each file handles a feature of WordPress. I.e.
comments.php deals with how the theme will handle comments;
image.php instructs the theme how to handle images, etc. Don’t worry about adding these files unless you need them.
At this time there are no required folders within a WordPress theme. However, WordPress does recognize the following folders by default:
The custom page templates, named page-templates (since: 3.4.0) allows for better organization of template files. Custom page template files placed in this folder are automatically recognized by WordPress.
If you wish to internationalize your theme so it’s usable in other languages, you can create a languages folder to contain translations.