WordPress Theme Development Tools

Before we get started building any WordPress Theme we’re going to need to get our development tools in place. In this post, we’ll run through the best of the best and build ourselves a cross-platform WordPress Theme test environment that would do a professional Theme developer proud.

A Local Test Server: XAMP or MAMP

The best place to develop your custom WordPress Theme is off the web, on your home computer. To do that though you’ll need to turn your computer into a “local server”, essentially approximating the program suite on a regular web server (Apache, MySQL and PHP). This means you can install WordPress on your home computer.

Installing these separate server programs can be technically challenging but luckily for us there are a couple of free programs that will install and manage all this for us.

If you’re on a Windows computer you’ll want to try out XAMP.

If you’re running a Mac you’ll want to download MAMP. It’s what I use and it does the trick.

WordPress

Of course, we’ll need to download the latest version of WordPress and get it correctly installed on your local test server.

If you’re using XAMP follow these instruction for installing WordPress on your local test server.

If you’re using MAMP follow these instructions for installing WordPress on your local test server.

Dummy Content

Your WordPress installation is going to need some sample, or dummy, content. Something to theme. In your WordPress admin navigate to Tools > Import and choose WordPress from the list of options. Now we only need a WXR post data file to import.

There are a few options:

Each of these test data sets has their pluses and minuses. One thing I like to do is import all the dummy content I can. Everything. That way nothing gets missed. When you think you’re done your theme, use the post navigation to browse through each post. Check out the archives for the month and year and category. With robust dummy content it’ll be easy to see if something’s amiss.

A Text Editor

You won’t need any special graphics software for creating WordPress Themes just a plain old text editor. But some are better than others, of course.

For Windows, you can try Notepad++. It’s free and open-source, and comes recommended by Lifehacker.

For the Mac, I recommend Smultron. It’s free, open-source, and—when you move to editing online WordPress Themes over FTP—works well with the popular FTP Client Cyberduck.

Firefox

Of course, you can use any browser for web development but the one I recommend is Firefox. Especially with the following 2 add-ons that will make your life a whole lot easier when it comes to developing with WordPress.

The Web Developer Add-on for Firefox adds a toolbar that gives you a whole host of options for inspecting and debugging your code, from disabling all CSS styles to validating local HTML (that’s the stuff happening on the browser screen of your test server).

The Firebug Add-on for Firefox is indispensable. With Firebug enabled you can click on any element in your browser window and see—in a window at the bottom of the screen—how it looks in the source code and how it’s being affected by CSS.

HTML and CSS

I won’t lie, a passing familiarity with basic HTML and CSS will help you out. I recommend reading through the HTML Dog HTML Beginner Tutorial and the HTML Dog CSS Beginner Tutorial . Reading through these two tutorials is completely optional but it won’t hurt and will help you grasp some basic concepts.

PHP

But what about PHP? Don’t you need to know PHP to create a WordPress Theme? Well, yes, you do. But I’ll be teaching you enough to be dangerous with a WordPress Theme as we go along. If you want to be a keener—always recommended—you can start reading through PHP 101: PHP for the Absolute Beginner. Again, completely optional. You’ll only need to pick up the basic concepts really.

How To Create a WordPress Theme

This post is part of a WordPress Themes 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

Don't forget: You should follow me on twitter here.

Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

63 Comments

  1. Posted June 23, 2009 at 6:19 am | Permalink

    thnx, great & simple

  2. Posted June 23, 2009 at 8:20 am | Permalink

    Great check list/guide to get started. If your looking to learn PHP then WordPress is a good project to work on as there are loads of tutorials out there and it will give you a real project to workon and so understand what bits of PHP do.

    Keep up the good work ThemeShaper, you rock! :)

  3. Posted June 23, 2009 at 9:05 am | Permalink

    Never seen Smultron before, looks pretty nice though. Worth noting that if you enjoy your foray into Wordpress theme construction money spent on a really good editor is money well spent. My personal favourite for Mac is Coda for HTML/PHP and CSSEdit for CSS, and for PC, Notepad++ (free!) and I actually use the new Expression Web, stripped of all the rubbish toolbars for my CSS.

    • Posted June 23, 2009 at 9:10 am | Permalink

      Absolutely. I just started using Espresso, myself. Though I still use Smultron for it’s advanced Find and Replace. It’s a really powerful text editor.

      • Posted June 23, 2009 at 9:31 am | Permalink

        Oh yes – Espresso is very nice too (but only works with 10.5+) – there are some helpful video tuts from Derek Renolds here: http://www.vimeo.com/derekr

      • Michael
        Posted July 25, 2009 at 11:00 am | Permalink

        Ian, in a post largely about installing MAMP I was surprised to see you are now using Espresso. To the best of my knowledge Espresso doesn’t play nicely (or at all) with MAMP, unlike Coda (and quite possibly a number of other editors).

        What is your workflow?

    • Posted June 23, 2009 at 9:26 am | Permalink

      I too was smitten with Smultron, but I always go back to my roots – BBEdit :)

      Great work as ever, Ian!
      thanks

    • Posted August 16, 2009 at 5:50 pm | Permalink

      I’ll cast a second vote for Coda! Excellent editor, and if you’re not using MAMP, the FTP integration with Transmit is PERFECTION!

      On Windows, Notepad++ is really an essential for replacing good ole notepad. I’m always surprised by developers at work who use Notepad and have never heard of Notepad++. I don’t know how they make it through the day…

      Cheers,
      Byron

  4. Kieran
    Posted June 23, 2009 at 10:28 am | Permalink

    Do you have any opinions on whether MAMP or the WordPress Bitnami stack (http://bitnami.org/stack/wordpress) is a better option for the local development environment?

    It seems like Bitnami has a very slight advantage of already including WordPress but there may be some usage issues down the road that I’m not aware of.

    • Posted June 23, 2009 at 10:31 am | Permalink

      I hadn’t heard of Bitnami but MAMP is going to win when you’re troubleshooting with Google. There are a lot of tutorials, tips, and tricks for it out there.

  5. Posted June 23, 2009 at 10:50 am | Permalink

    I was expecting something a tad meatier actually.
    My excitement is building up!!

  6. Posted June 23, 2009 at 11:02 am | Permalink

    Enjoying this series, thanks for it. One question – in Mac OS X Leopard you can turn on web sharing and get a local server on your computer with Apache, PHP, and mySQL, correct? I’ve seen recommendations for MAMP before, and always wondered what the benefits to using it are as compared with the built in functionality in the OS. I’ve successfully run Wordpress test installations using the OS web sharing on my macbook pro in the past, but always encountered problems when trying to import data, install plug-ins and themes via the Wordpress admin, etc. Thoughts?

    • Posted June 23, 2009 at 11:15 am | Permalink

      Basically Mamp gives you a super-handy interface for interacting with everything—all in one place—via a preference pane and start page.

  7. Kyle
    Posted June 23, 2009 at 11:09 am | Permalink

    Is it possible to do plugin/wordpress upgrades through MAMP? I always run into something like this:

    Downloading update from http://downloads.wordpress.org/plugin/akismet.zip

    Download failed.: connect() timed out!

    Plugin upgrade Failed

    Just wondering if it’s a MAMP limitation (upgrades work fine online), or something else I can look at.

    • Posted June 23, 2009 at 11:17 am | Permalink

      Absolutely. You probably just need to upgrade your memory in MAMP. It’s in the PHP ini file.

      • Kyle
        Posted June 23, 2009 at 11:32 am | Permalink

        Hrmm, didn’t seem to do anything – I get the message essentially instantly after I click UPGRADE AUTOMATICALLY. Do you think the fact that I’ve got it setup as a virtualhost might be the root of the problem or should that work fine? PHP and Apache logs return nothing. Thanks for the quick reply.

    • Posted June 23, 2009 at 12:23 pm | Permalink

      It could be the virtualhost setup.

  8. Craig Burgess
    Posted June 23, 2009 at 11:42 am | Permalink

    Ian,
    be sure to check out The Uniform Server, http://www.uniformserver.com/ for Windows OS machines – it blows away XAMP for compactness and ease of use. I was a XAMP fan, but got tired of remembering all the different setup procedures, and the size if of it. This is under 10 mb last time I checked.

  9. Posted June 23, 2009 at 12:06 pm | Permalink

    I’ve been running a local testing version of WP from a flash drive for some time using MoWeS, which allows you to install WordPress along with your server setup (Apache2, MSQL5, PHP5, PHPMyAdmin) on a portable drive. Works like a charm!

  10. Greg Turner
    Posted June 23, 2009 at 12:13 pm | Permalink

    I stop at this step because I already have tomcat and mysql services running in the background on my PC. I am afraid that any turnkey install like XAMP would mess up what I already have running. If I could find more info about what’s involved in the install of wordpress, then perhaps I could manually install wordpress and integrate it with what I already have running. Any tips in this regard would be helpful. Thanks

    • Posted June 23, 2009 at 12:18 pm | Permalink

      If it works like MAMP it shouldn’t be a problem—but a check at the forum would probably be worthwhile.

  11. Posted June 23, 2009 at 12:57 pm | Permalink

    Got ‘em all. :)

    On Linux using the Gnome desktop, it comes with gphpedit for a text editor. Has line numbers, syntax highlighting, tabs, – pretty handy.

  12. Posted June 23, 2009 at 1:24 pm | Permalink

    hi

    Am running ubuntu, how do i do a local install of apache etc.

    thanks

    keep up the amazing work

    ciao

    • Posted June 23, 2009 at 2:01 pm | Permalink

      In general, you should be able to go to Add and Remove Software and search for what you want. This type of software would be under Servers or something to that effect.

      In Fedora the command under root in the terminal is, “yum install httpd php-mysql mysql-server”. This installs Apache, PHP, PHP/MySQL linker, and MySQL. It shouldn’t be too different in Ubuntu. I know it uses “apt-get” instead of “yum” and it might refer to Apache as “apache2″ instead of “httpd”.

      If none of the above helps, or works, I’d search on a search engine. Then ask in the Ubuntu forums.

  13. Posted June 23, 2009 at 1:35 pm | Permalink

    Wonderful starting point. I will refer people to this tutorial series. I know you will take your time with the content and produce quality instructions.

    Also, thanks for the links to extra dummy content. I only had the wpcandy content – more is always useful!

  14. Posted June 24, 2009 at 12:32 am | Permalink

    This is exactly what I was looking for. Many thanks.

  15. Posted June 24, 2009 at 1:06 am | Permalink

    I have never heard anyone suggest Smultron before, I’ve been using it for years, but everyone always looks blankly at me when I mention it!

  16. Posted June 24, 2009 at 2:10 am | Permalink

    Ian,
    I have used my localhost for some time for installs and changes before upload, so I have a database already. For whatever we are going to do can we just make another database and use it for our class.

    THANKS

    JIM

    • Posted June 24, 2009 at 6:34 am | Permalink

      You can keep on using that existing database if you like or go ahead and make another one.

  17. Posted June 24, 2009 at 2:22 am | Permalink

    I am currently working on the design of my blog, so this tutorial has come at the right time for me. This is exactly the kind of post that I need to dig into. I left web design for a very lone period and just starting to refresh the skills back. Thanks a dozens for posting this.

  18. Posted June 24, 2009 at 10:06 am | Permalink

    This is great for me. I just started using Wordpress and very interested in a personal design for it (I intentionnaly kept the default theme in order to show the evolution for my readers).
    I just have a question regarding the browser. What is your opinion on Safari 4? Do you think it can do the job with the new development fonctions?

    Tanks

    • Posted June 24, 2009 at 10:11 am | Permalink

      I haven’t fooled around much with the inspector in Safari but if you’re more comfortable using it, I’d go ahead.

  19. Sam
    Posted June 24, 2009 at 1:34 pm | Permalink

    Funny, I was thinking last week, no one ever talks about the mundane stuff like setting up a test environment, or how to move your finished theme from your test server to a production environment. This is the sort of stuff I end up spending hours on. Thanks for exploring the less thrilling aspects of theme development.

    AnandP asked about setting up a test server on ubuntu which is the test environment I use. Not easy to get started with but very productive after the learning curve. A Google search for “ubuntu tasksel lamp-server ” produces a good answer to the “how to” question.

  20. Posted July 2, 2009 at 8:03 am | Permalink

    I prefer WAMP on Windows over XAMP and I use Crimson Editor.

    • Posted August 19, 2009 at 11:44 am | Permalink

      Also prefering WAMP, really easy to install. Didn’t know Crimson editor, so I can’t compare with Notepad++ I use. Notepad++ includes ANSI/UTF8 conversion tools, really useful when adding i18n content to an ANSI file (e.g. in a WP theme).

  21. Posted July 3, 2009 at 9:39 am | Permalink

    Wow great article. I hadn’t heard of XAMP before and it is perfect for working on my blog offline. Nothing like a good test environment to try out some ideas and learn wordpress/php.

  22. marcus
    Posted July 29, 2009 at 9:57 am | Permalink

    Hi,
    I’m trying to set up Dev/Test and Production Environments for my wordpress website. I want to use the Test environment to try out new plug ins and upgrades before uploading to my production website.
    Can you recommend the best way of doing this?
    I’m using MAMP on my computer for the Test Environment but seem to require a lot of manual processes (ie., adding each plug-in separately)
    Best advice so far is http://www.dountsis.com/php/setup-a-development-environment-for-your-wordpress-site.php
    but i can’t get it working… any other ideas?

    • Posted July 29, 2009 at 10:34 am | Permalink

      Well, once you get MAMP and WordPress setup you can add all the plugins through the WordPress admin. No downloading and unzipping required; it handles everything for you.

  23. Ronnie
    Posted July 31, 2009 at 9:34 am | Permalink

    Thank you so much. Just what I needed. :)

  24. Posted August 11, 2009 at 8:32 am | Permalink

    Forgive my Newbie question, but I got lost at step 4 in the Installing Wordpress to MAMP. Where is the MAMP document root? I thought this was saying to create a folder in my sites folder, but when I go to localhost/wordpress, it says “no tables found in database.” I’m stuck.

    Step 4: Downloading and Installing WordPress
    Now it’s time to download WordPress. Once you’ve downloaded and unzipped the WordPress download, open up the “wordpress” folder. Click and drag all of the files from the wordpress folder to your MAMP document root (I use /Users/USERNAME/Sites/wordpress/).

    Lastly, we’ve got to run WordPress’ famous 5-minute install. Visit your local site (localhost:port or localhost:port/wordpress), and enter the following information into the database setup form:

    database name: wordpress
    database host/server: localhost
    database user: root
    database password: root

  25. Posted August 16, 2009 at 12:33 pm | Permalink

    Excellent Resource for a NewBie like me. Thanks a Lot

  26. Posted August 16, 2009 at 2:06 pm | Permalink

    Awesome totally rocking i am already using Xmapp to tweak my themes locally.Will try how 2 create one using this one … thanks a ton ..

  27. Posted August 17, 2009 at 1:52 am | Permalink

    Very nice and neatly written. Very good for a newbie to start off. Keep the good work up guys.

    Regards,
    Sam.

  28. Posted August 17, 2009 at 7:16 am | Permalink

    Please notice also that since yesterday, there is an additionnal tool for CSS with WP-LESS. I’ll roll out an update to make it embeddable by theme developpers.

  29. Posted August 17, 2009 at 9:34 am | Permalink

    I’m a huge fan of Notepad++ but one thing you need to pay attention to is that with updates, it sometimes saves UTF-8 files with leading Byte Order Mark entities in the file. PHP does not like this and can cause lots of frustration. So make sure that you turn it off.

    If you suspect that you’ve saved one of your theme files with BOM, you can check your files with this tool. For example,

    http://people.w3.org/rishida/utils/bomtester/index.php?filename=http://ashford.turtleinteractive.com/

  30. Posted August 17, 2009 at 2:27 pm | Permalink

    Very good resource. I’ve had many problems setting up PHP on Vista and most recently Windows 7, until I found XAMMP.

  31. Conrad King
    Posted August 17, 2009 at 8:36 pm | Permalink

    Thank You Much, :-) Very kind of you..

  32. Posted August 21, 2009 at 4:44 pm | Permalink

    nice tips, great and simple

  33. Gary
    Posted August 25, 2009 at 2:34 pm | Permalink

    I’ve just tried the first of three dummy content generators that I downloaded, out of the four that you’ve listed, and think I’ve run into a problem.

    My development WP system is fully up to date – v2.8.4. But all the content seems to have been output from earlier installations – two at v2.6 and the third possibly from v2.7. Since databases are automatically updated when you do an upgrade, is it not fair to assume that the data structure which is used to do an export might not match today’s version of WP? And that while the files might not cause any problems, they might actually cause major problems, corrupting databases if the importer isn’t smart enough to detect this discrepancy.

    Update – after allowing the importer to sit for five minutes or more (after clicking the [Upload file and import] button) without getting beyond step 1, I cancelled it. Fortunately, it doesn’t seem to have caused any damage. But neither did it check for version compatibility and say that it couldn’t process the file…

  34. Posted September 6, 2009 at 1:57 am | Permalink

    I think one thing is not on that list and can be really usefull ,
    That is some virtual machine (even the free microsoft one) to support multiple installations of different versions of IE – e.g. IE5.5 IE6 IE7 etc.. on the same machine. smae could be done with all major browsers for compatibility check

  35. Posted October 2, 2009 at 2:59 am | Permalink

    Very Very Interesting Article. Thanks for helpful information.

  36. Posted October 14, 2009 at 2:16 am | Permalink

    Very Useful information for Web Developers. Nice sharing Informative blog.

  37. Posted October 15, 2009 at 3:56 am | Permalink

    Nice info, I am using easyphp as it is light. can you provide a ebook on wp theme editing ?

  38. Alistair
    Posted October 30, 2009 at 3:20 pm | Permalink

    Just FYI – Smultron development is officially dead: http://smultron.sourceforge.net/

    His quote:

    First of all I’d like to thank you for your interest in my applications. But I have now come to a point where I don’t have the time to spend on the applications that they deserve so I have decided to not release any more versions for the foreseeable future.

  39. Posted November 1, 2009 at 12:33 pm | Permalink

    One of the best tutorials on WordPress theme development on the Internet.
    Thanks a lot.

  40. Posted November 20, 2009 at 12:20 am | Permalink

    hi Ian thanks for your great tutor. I also heard that there is a dreamweaver addon/extention for creating/modifying WP theme, don’t know is it worth or not to buy it but from your tutor it seems no need to buy that :)

  41. Posted January 5, 2010 at 6:27 am | Permalink

    awesome tools on word press themes.

  42. Posted January 6, 2010 at 5:53 am | Permalink

    Nice tools, thanks sharing with this informative post.

  43. Posted January 18, 2010 at 11:14 am | Permalink

    i am trying out my best.great article about creating WP theme .i am using wordpress for creating my site.i use others wp theme .but i am going to create my own WP theme following those article and tools .

  44. Posted January 22, 2010 at 3:15 pm | Permalink

    Very well done tutorial. Now I finally have a testing server installed on my computer – it’s exciting! Looking forward to continuing…

  45. Posted February 10, 2010 at 9:31 pm | Permalink

    This is damn comprehensive! Thanks, you rock!

  46. Posted February 22, 2010 at 5:52 am | Permalink

    God Bless you for writing such a beautiful article. Just following the steps. Hope to make my own theme one day . :-)

  47. Posted July 25, 2009 at 6:53 pm | Permalink

    I’ve found Espresso working great with MAMP but right now I’m using Textmate.

11 Trackbacks

  1. By links for 2009-06-23 | Links | WereWP on June 23, 2009 at 9:04 am

    [...] WordPress Theme Development Tools A few days ago, I told you about Ian Stewart's initiative to renew WPDesigner's Wordpress theme tutorials, and teach us how to create a WordPress theme from scratch. Well, here is the first tutorial, it covers all you need before to actually start working on the theme. (tags: WordPress theme tutorial) Leave a Reply Click here to cancel reply. [...]

  2. [...] Read the original here:  WordPress Theme Development Tools [...]

  3. [...] View original post here:  WordPress Theme Development Tools [...]

  4. [...] WordPress Theme Development Tools Share and [...]

  5. By WordPress 主题开发工具 | 精品博客 on June 26, 2009 at 9:01 am

    [...] 原文:WordPress Theme Development Tools [...]

  6. [...] partly via:themeshaper [...]

  7. [...] WordPress Theme Development Tools.: ThemeShaper puts together a list of many of the ingredients required to develop your own WordPress themes including the test content that helps to test the demo the functionality of WordPress themes and tutorials to help beginners get started. The inclusion of useful development tools such as Firefox extensions and even links to free text editors are appreciated. The one inclusion that I would have expected from the blog of a theme framework developer would have been a list of theme frameworks that a beginner could get started with. (No Ratings Yet)  Loading …   Visited 20 times, 20 so far today [...]

  8. By WordPress Theme Development Tools | Wp Themes on August 16, 2009 at 10:52 am

    [...] WordPress Theme Development Tools.: ThemeShaper puts together a list of many of the ingredients required to develop your own WordPress themes including the test content that helps to test the demo the functionality of WordPress themes and tutorials to help beginners get started. The inclusion of useful development tools such as Firefox extensions and even links to free text editors are appreciated. The one inclusion that I would have expected from the blog of a theme framework developer would have been a list of theme frameworks that a beginner could get started with. Click here to cancel reply. Name [...]

  9. By WordPress 主题开发工具 at Jolin Stone in Here on December 21, 2009 at 8:27 pm

    [...] 原文:WordPress Theme Development Tools [...]

  10. [...] Theme Development Tools [...]

  11. [...] Theme Development Tools [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution. In addition, you may find yourself fitter, happier and more productive. Comment away.

Subscribe without commenting