I recently created a customized WordPress theme for a friend and thought I'd share how I set up my development environment.

STEP ONE
Install MAMP.

STEP TWO
Download a theme to modify (recommended) instead of starting from scratch. I prefer the underscores theme provided by Automattic.

STEP THREE
Download WordPress.

STEP FOUR
Put the zipped WordPress file into the directory you plan on working in. Unzip the WordPress file.

STEP FIVE
Launch the MAMP application (not the PRO version). And click Start Servers. You can access the application by going to your Applications -> MAMP/ -> double-clicking MAMP.

alt

STEP SIX
Go to http://localhost:8888/phpMyAdmin/?lang=en. Click the Database tab at the top of the page. Create a new database. I named mine dk_wordpress. Don't worry about changing the "Collation" drop-down.

alt

STEP SEVEN
Now, go to your working directory where WordPress was unzipped. Open the WordPress folder in your text editor. Access the wp-config-sample.php file. Rename it as wp-config.php.

Change these lines of code from:

define('DB_NAME', 'db_name');

define('DB_USER', 'username');

define('DB_PASSWORD', 'password');

To this:

define('DB_NAME', 'YOUR_DATABASE_YOU_CREATED_IN_STEP_6');

define('DB_USER', 'root');

define('DB_PASSWORD', 'root');

STEP EIGHT
Go back to MAMP, Click Preferences and then click the Web Server tab. Click on the Document Root option to open up your finder and select the folder you unzipped WordPress in. Then click OK.

alt

alt

alt

STEP NINE
Go to http://localhost:8888/wordpress/wp-admin/install.php in your browser.

Go through the WordPress site creation process.

alt

alt

STEP TEN
Log into the site.

STEP ELEVEN
Go to Appearance -> Themes in the left sidebar. And click Add New Theme.

alt

alt

STEP TWELVE
Make sure your theme is zipped. Upload your theme.

STEP THIRTEEN
You can then activate your theme assuming no failures have occurred.

alt

STEP FOURTEEN
Once your theme is activated, you can open the theme folder in your text editor. To open your theme folder, go to the directory you unzipped WordPress in step 4. Open the WordPress folder and navigate to wp-content/ -> themes/ -> your theme.

alt

Any changes you make will be reflected on your WordPress site automatically. You can see your changes here after following the above steps.

RECOMMENDED RESOURCES FOR WORDPRESS THEME DEVELOPMENT
1. WordPress Theme Documentation
2. Team Treehouse Tutorial

Tags: