How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial

Update: We’ve created a second edition of this popular tutorial! It contains updated code samples, coverage of the latest theme development techniques, and more. Check it out at The ThemeShaper WordPress Theme Tutorial: 2nd Edition.

In only 11 individual lessons this WordPress Theme Tutorial is going to show you how to build a powerful, up-to-date, WordPress Theme from scratch. As we go along I’ll explain what’s happening including (for better or worse) my thinking on certain techniques and why I’m choosing one path over another. Essentially, I’ll be teaching you everything you need to know about WordPress Theme development.

Skip to the Table of Contents.

tutorial-graphic-large

Here’s the list of features your finished theme will be able to boast of:

  • All the search-engine optimization you’ll really need
  • Including google-supported Microformat markup
  • Valid and logical semantic markup structure than can be used to create ANY layout
  • Smart default CSS layouts
  • Dynamic Body, post and comment classes
  • Separated trackbacks and threaded comments
  • 2 widget areas coded to disappear when they’re empty
  • And all the typical WordPress stuff you expect from a theme

I think that’s kind of impressive—for any WordPress Theme.

At the end of this tutorial, with code in hand, you’ll be able to do almost anything you want. You can even think of the finished Theme as your own personal website development framework for WordPress.

I’ve already used it to start another project of my own, The Shape Theme. Download it and check it out if you’d like to see some of the finished code we’ll be going through, live, in action. Alternately, you can browse through the up-to-date source code for the entire tutorial on Google Code.

WordPress Theme Tutorial Table of Contents

Ready for a WordPress Theme Tutorial that will show you how to create a powerful WordPress Theme from scratch? Read it from the beginning and code yourself up something awesome.

  1. WordPress Theme Tutorial Introduction
  2. Theme Development Tools
  3. Creating a Theme HTML Structure
  4. Template and Directory Structure
  5. The Header Template
  6. The Index Template
  7. The Single Post, Post Attachment, & 404 Templates
  8. The Comments Template
  9. The Search Template & The Page Template
  10. The Archive, Author, Category & Tags Template
  11. The Sidebar Template
  12. Reset-Rebuild Theme CSS & Define Your Layouts

318 responses

  1. […] sit down in an afternoon with my PSD mockup and throw together a WP theme in no time. So, I found this great tutorial on writing a WordPress theme from scratch and I was off to the races. Or so I thought. Turns out, this stuff is quite a bit of […]

  2. […] interested in reading more about what's in a theme then there's a thorough guide to making a theme here. Or feel free to ask here and I'm sure at least one of us will jump in. __________________ […]

  3. […] Cómo crear un tema de WordPress: El último tema de WordPress Tutorial – Un muy en profundidad tutorial para crear temas de ThemeShaper. […]

  4. Awesome tutorial, I am now going to start my first WordPress theme with your site open as I go along. I will no doubt add comments later with a peek at my work. If it turns out any good of course 🙂

    Thanks.

  5. […] 9. How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  6. […] 7. How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  7. Thank you for your generosity in sharing these detailed instructions and files. It was a great source of reference as I setup my 1st WordPress template.

    thank you,

    ~ gabriel

  8. […] WordPress Theme Tutorial Introduction […]

  9. […] Themes THEMESHAPER WP DESIGNER DESIGN REVIVER NET TUTS PLUS THEMETATION ADOBE DEVELOPER […]

  10. Big big thanks!
    I just type “how to create a wordpress theme” and pam, falling into your site that i think, will be really useful for me!
    *Run to read your tutorials*. ❤

  11. […] check it click here . . . . start your own theme […]

  12. […] How to Create a WordPress Theme: The Ultimate WordPress Theme Tutorial – An extremely in-depth tutorial for creating themes from ThemeShaper. […]

  13. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  14. […] komme ud i alle hjørnerne af et tema. Efter at have googlet emnet, fandt jeg denne tutorial hos themeshaper. Den ser ret avanceret ud og vil sandsynligvis vise mig alle de ting jeg har brug for at […]

  15. […] How To Create a WordPress Theme – Over the next 12 days this WordPress Themes Tutorial is going to show you how to build a powerful, up-to-date, WordPress Theme from scratch. As we go along I’ll explain what’s happening including (for better or worse) my thinking on certain techniques and why I’m choosing one path over another. […]

  16. Thanks Ian for the tutorial. I’ve just started.
    One thing that would be helpful is for one to see how current this tutorial is. I went through another tutorial series that I thinks was about 4 years old. I now the basics of WP development remain, but it would be nice to know that there have been regular updates.

    For example I would say right your home page:
    • This tutorial was originally written on xx/xx/xxxx.
    • The most recent update was on xx/xx/xxxx.

    This would give me confidence that you are still actively monitoring things and updating things for the tutorial.

  17. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  18. nice trick..

  19. I already love the ‘Shape’ Theme. I’m looking forward to learn from this tutorial so i’ll be able to make it my own.

  20. […] custom WordPress themes from scratch rather than modifying an existing theme, Ian Stewart’s 12-step tutorial at themeshaper is a great place to start. Ian walks through the process of coding the core PHP files needed for a […]

  21. […] 3. How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  22. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  23. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial. […]

  24. […] to start from, but didn’t find anything that matched my taste. I ended up following this great tutorial from Ian Stewart to create a theme from scratch. Ian goes in great details about every single step […]

  25. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  26. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  27. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial – works more on the template level than design. Very informative, nonetheless. […]

  28. Fantastic tutorial to build a clear structured default theme to base all future websites on!
    Thanks so much for putting it all together!

    One sidenote though, there is nothing about the footer template and a lot of plugins won’t work when is not called for.

    I also second Bob T's suggestion to show how current the instructions are.

    1. code didn’t make it through, I meant wp_footer();

  29. Hi,

    You can send your design and get that converted to WordPress, PSD TO WORDPRESS code your design to a WordPress Theme.

    The website is http://www.psdtowordpress.eu/

    They do cross-browser compatible valid WordPress Theme and they offer a Non Disclosure Agreement (NDA) for all customers.

    Hope it’s useful 🙂

  30. I tried to design my own webpresss theme for my website last year but in the end gave up because it was just too hard. My photoshop skill and html coding have improved a great deal now so I will give it a go again after reading this insperational tutorial.

  31. David Simpson Avatar
    David Simpson

    Just have to say great tutorial – just what I was looking for. Thanks!

  32. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  33. Thank you for this cool tutorial 🙂

  34. […] features a great tutorial that walks you through all aspects of building your own WordPress theme, yet keeps everything […]

  35. […] The Ultimate WordPress Theme Tutorial An 11-part tutorial series from Ian Stewart that takes you through the process of creating a theme from scratch […]

  36. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial […]

  37. […] designed WordPress Theme.  I worked this baby up from scratch thanks to a brilliant tutorial by Ian Stewart of Theme Shaper, and I’m super pleased with the result.  Knowing me of course I’ll get bored with it […]

  38. […] How To Create a WordPress Theme: The Ultimate WordPress Theme Tutorial (tags: wordpress tutorial) […]

  39. I like the way you show to us how create wordpress theme. Thanks for your kind heart.

  40. Thanks a lot!! I had moded themes before, but this is the first time i had to create a couple from scratch and w/o this guide it wouldve been an even dautiner task.

  41. […] it’s with that in mind that I’ve began following this tutorial on building a WordPress theme. You’ll notice that my current theme isn’t one I’ve made myself, and I think […]

  42. […] WordPres 主题开发教程的中文版。这套教程的名字叫做 How to Create a WordPress Theme ,中文为:如何创建 WordPress […]

  43. […] new design for it every two or three days and not get bored. Because I got the main framework from this post here. It’s bloody amazing. I just need to figure out how to edit the comments template and the […]