WordPress Cheat Sheets: Theme Anatomy Model
- WordPress Cheat Sheet: The Loop Code Snippet
- WordPress Cheat Sheets: The Loop Visual Model
- WordPress Cheat Sheets: Theme Anatomy Model
- WordPress Cheat Sheets: Template Heirarchy Map
Next in line for our WordPress Cheat Sheet series, The Basic WordPress Theme Anatomy Model! If you haven’t seen the first posts in this series, this is a new batch of these quick pocket guides that you guys n’ gals can download, save to your phones for a fast reference, or even print out and keep next to your desk while you’re working on customizing WordPress to do your bidding.
This is what’s generally considered to be the “basic theme anatomy”. It’s important to note a few things though: Not every file that a theme can use is present here (we’ll actually have a massive cheat sheet on that in the next Cheat Sheet installment!). Also – technically, all you actually need to create a theme is a single “style.css” file… so you don’t need each of these files shown either, although most themes nowadays (except child themes) will use all of these at a bare minimum.
This is simply a rough diagram to give you an idea of what makes up the most generic of WordPress themes out there! A quick visual model that can be a great helper when trying to wrap your brain around what goes into a WordPress theme for the first time (or the thirtieth!). It doesn’t include everything that you can possibly do with it (ie: deep hierarchy templates aren’t shown), but it’s a simple model that should pair nicely with coded tutorial on the site, like this one we just started: WordPress Theme Development Training Wheels .
Don’t Miss…
Don’t miss out on our full Developing Your First WordPress Theme series, or our Guide To Creating a Child Theme in WordPress, which plays right into the content of this cheat sheet.
Oh, and we’ll be doing our best to keep these sheets updated as WordPress grows into new versions, but if you spot an error (or just want to send some love), let us know in the comments!









I really like this Cheat Sheet, but I can’t help but notice the use of Index.php and Home.php.. How would you define the difference?
It goes like this in terms of hierarchy (which the next cheat sheet will examine): front-page.php > home.php > index.php - This essentially allows you to specify a dedicated homepage template without using the index file, which is largely intended to be the “backstop” when all other options have been exhausted. Remember, index.php is what gets used if you don’t have a particular template like page.php, single.php, category.php, etc… Index is there to spit out all sorts of content (from categories to tag pages to 404′s even); the only job that home.php has is to create a pretty homepage. In lots of cases, you just need index.php – home.php is a special use file when you want to create a special design for the homepage that’s different from, say, a normal category listing.
The difference between front-page.php and home.php is a little different: front-page.php can’t be overridden from the Settings > Reading page, home.php can (so it’s preferable in most cases).
The next cheat sheet will help out a lot on this though as it’ll include an actual model of the hierarchy process.
Oh, and this is actually a highly discussed topic on the official WordPress forums… it almost seems as though if you ask 10 different developers you’ll get 10 different answers, but I’m pretty sure from a practical themeing standpoint, my explanation above hits the main points. Front-page is the new template to use as of WP3.0+, but I personally still use home.php in my own themes as front-page.php seems to be a little overly-prioritized in the hierarchy. If anyone out there has the definitive, technologically sound answer, leave a comment!
Thanks for the excellent response. I can see how it’s interpreted differently by many other, but your explanation definitely makes sense!
“The difference between front-page.php and home.php is a little different: front-page.php can’t be overridden from the Settings > Reading page, home.php can (so it’s preferable in most cases).”
I think this is a bit misleading.
The mentioned setting doesn’t override directly what template file is used. It just defines where the standard blog sits. And the blog looks for home.php, whether it’s on the actual home page or not. In other words, if a static page is set as the actual start page, it NEVER looks for home.php (although the name might suggest so), but for front-page.php.
Good point Danilo
Thanks for the clarification!
Per usual Brandon, you are the man! Thanks for the awesome cheat sheet.
Thanks Mr. Nunn!
This and the other cheat sheet could make for a neat poster, or desktop wallpaper
Right now they’re printable at letter size (8.5″ x 11″), but I’ll likely come out with a master poster of a few of these in the future if enough people would like one! Thanks Cory!
@Brandon, yes I guess most of us would want the poster.
thanks, is great cheat sheet!!!
saludos….
A collection of thoughts, resources, and references designed to help every one!
Thanks, really tho these are very common templates and anyone who has looked at building their own theme would understand these.. don’t get me wrong but it seems this site posts a lot of info that is already widely available… how about posting some unique content ?
Like we do the other 6 days of the week?
These cheat sheets are really just here to round out our already pretty wide coverage of WP related stuff… if this were the only type of content that we were publishing, sure, I’d see your point. But we pretty much have a new, original article or tutorial every day of the week, so having a few posts like this that people enjoy probably isn’t hurting anyone… furthermore, I am creating/designing these from scratch to be different and/or better than any other cheat sheets that I could find (most of which are old… circa 2008/9), so they are original whether the concept of a cheat sheet is or not. Thanks for the feedback either way!
Hi all,
Just set my self to learn webdesign and wordpress theme-ing … I am glad to see a new series of Wrodpress theme design as well as these nicely prepared cheat sheets; here at WP Tuts. Keep up the great work WP Tuts Team
Regards,
Mahfoodh
I always love a good cheat sheet. Thanks Brandon.
Nice cheat sheet! Pretty useful for a beginner like me!
Oh my, thanks for this one! Really helpful for us , visual learners.
This is my “penny dropped” moment, after all these weeks learning WP!
Thank you!!!
This is a interesting publish! Many thanks for this! Using best regards Luke aka couchgool.