Develop Wordpress themes locally on your Mac

MAMP - Macintosh, Apache, MySQL, and PHPWhen it comes to designing and developing your own custom Wordpress theme it can be a little tricky. You have to learn how the Wordpress theme files work, while trying to make your vision of your site come to fruition. But instead of installing Wordpress on your live site and then rushing to get your design completed, try installing Wordpress locally.

By installing Wordpress locally on your computer you are able to spend as much time as you want designing, developing and tweaking your theme without the worry of breaking your live site or having visitors see a half completed design.

And the best part is that installing Wordpress locally is actually very easy to do on a Mac running OS X 10.4.x or later, and you don’t need any programming skills.

To start with you need MAMP, which stands for Macintosh, Apache, MySQL, and PHP. It is an application which allows you to use a local PHP server and MySQL server on your computer. This then gives you the tools you need to install and run WordPress on your machine.

Step 1: Download and Install MAMP

First you will need to download MAMP (NOT MAMP PRO), the download is approximately 130 MB. Once it has downloaded, extract the zip file and double-click the dmg file. You will now have the MAMP installation window, so drag the MAMP folder to your Applications folder.

Step 2: Setup Basic MAMP Settings

MAMP ApplicationNow that you have installed MAMP, go to /Applications/MAMP/ and launch the MAMP.app. When running MAMP you may be required to input your administrator password.

Once you have opened MAMP click on Preferences. Under the Ports tab you can choose to change the default ports for Apache and MySQL. If you leave them as they are, 8888 and 8889, then you will need to use these in your local URL e.g. localhost:8888. If you don’t want to have the port numbers in the URL then you can change the Apache port number to 80, however if you do this then you will always be asked for your password. I recommend leaving the port numbers as the defaults.

MAMP PreferencesUnder the PHP tab you can choose the version of PHP you want to run, PHP 4 or PHP 5. This won’t effect Wordpress itself, but it will effect a plugin if it requires PHP 5.

Lastly, on the Apache tab, you’ll need to set a document root. This is where all of your files are going to be for your local web server. An example of a document root is /Users/USERNAME/Sites/wordpress/.

Once you have finished editing the preferences, press OK.

Step 3: MAMP Serves and Creating Databases

If the servers are not already running (indicated by a green circle next to Apache Server and MySQL server), click Start Servers. The MAMP start page should also load into your default browser (if it hasn’t, click Open start page).

phpMyAdmin Create New DatabaseOn the start page, click on phpMyAdmin in the top menu. Now simply find Create New Database and enter a database name in the field (such as wordpress) and click create. You have now created your Wordpress database.

Step 4: Download and Install Wordpress

Next, download the latest version of Wordpress, extract it and then move all of the files into your document root that you set earlier (e.g. /Users/USERNAME/Sites/wordpress/). Now rename the wp-config-sample.php file to wp-config.php. Open it in a text editor and change the following:

  • define(’DB_NAME’, ‘wordpress’);
  • define(’DB_USER’, ‘root’);
  • define(’DB_PASSWORD’, ‘root’);
  • define(’DB_HOST’, ‘localhost’);

Now in your web browser, go to the URL localhost:8888 and enter a blog name and email and you are done.

Step 5: Start developing!

That’s it, you now have a local copy of Wordpress to start playing with. In order to use the local version you need to start the MAMP servers and go to localhost:8888. Easy!

Designing locally is also great because you can edit the theme files (html and CSS) with your favourite text editor. You don’t have to edit through the Wordpress dashboard, which is great if you like to keep your html and CSS formatted neatly.

Once you are happy with your design you can then upload the theme files (and any plugins you need) to your live installation of Wordpress. You will of course still need to spend a bit of time setting the blog up how you want, changing preferences, adding content etc, but at least you have been able to design and create your custom theme in your own time.

6 Comments

  1. David Says:

    Thanks! Just what I was looking for.

  2. JJ Spelman Says:

    Thanks Helen for getting me started. I know nothing of this and am looking forward to playing with it. I LOVE your background design! ;-)

  3. Mac Says:

    Thanks! I’m a teacher developing a new website for the next school I’m staring in this fall. It’s great to be able to get this part of my site ready before I have access to the server!

  4. Mac Says:

    that should have read ’starting’…. my head’s not quite big enough for ’starring’ to be the right word…

  5. Антон Павлович Says:

    Спасибо < a href=”http://www.saw6online.ru” > < /a >…

  6. CARLTON Says:

    < blockquote >< a href=”http://medicamentspot.com/”>MedicamentSpot.com. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. High quality pills. Buy drugs online< /a >…

    Buy:Actos.Zyban.Prednisolone.Lumigan.Arimidex.Valtrex.100% Pure Okinawan Coral Calcium.Petcam (Metacam) Oral Suspension.Synthroid.Human Growth Hormone.Retin-A.Prevacid.Zovirax.Nexium.Accutane.Mega Hoodia….

Leave a Reply

Please enter the 2 words in the box below then press Submit to continue: