I am sure a lot of you have created awesome WordPress sites on your local PC/Laptop, and spent ages using some outdated search and replace plugin trying to update all those http://localhost/ urls.
In this tutorial I’m going to show you the best way in my opinion to create and develop a child theme and use local DMS resolution so all those pesky urls stay the same. Can it be done you ask? Sure and actually its easier than you think!
Getting Tooled Up
Choosing the right tools for any job is important. Of course a lot depends on the host OS but for the purpose of this post we’re using MAC OSX.
To run WordPress locally you are going to need a webserver. MAMP is the perfect tool for the job here as it offers the latest PHP/mySQL with a nice UI.
We are using the PRO version as it includes unlimited local domain resolution.
To get WordPress up and running with MAMP the WordPress Codex has a nice little writeup here.
After installing you need to make a couple of changes to the usual settings.
The default ports for MAMP are set to 8888 and 8889 for Apache and mySQL.
This is so MAMP does not need super user privileges when it starts up but you should change them to 80 for Apache and 3306 for mySQL.
Also make sure the username/group is set to your username and group like I have in this screenshot.
You need to do this so WordPress does not need to ask for permissions to install plugins and write files.
Next you are going to need a decent text editor.
Create the site
Now its time to create your first localhost site.
So lets pretend you have a client with a proposed URL that is http://www.some-random-site76.com
We are going to use MAMP Pro to simulate that domain locally so all the image/css urls in the database will be http://www.some-random-site76.com and not something like http://localhost:8888/wp1/.
The reason for this is that you wont have to go into the database and do a search and replace to get rid of all those nasty localhost urls.
At this point if you open the URL in your browser you should see the default MAMP welcome page looking something like this.
The next step is the one your used to, installing WordPress and DMS.
Nothing unusual here just follow the normal install process remembering to use the url you setup in MAMP.
Check out the next page where we create a child theme.