WDSK 1.1: Setup your Development Environment!
By "your development environment", I mean "everything you need in order to produce and maintain your project on your local machine."
By "setup", I mean "setup".
Components of the WordPress DevEnv
- A good text editor
- The latest version of WordPress
- A GitHub account
- Less Compiler
###A Good Text Editor*
The more code you write, the more you'll care about having a good text editor. At a minimum, you'll want an editor that allows you to view and switch between all your project files easily.
Though there are free editors out there, I'd highly recommend you invest in either Sublime Text or (if you work from a mac) TextMate. These are editors don't require any fancy knowledge to get started, but they have plenty of advanced awesomeness for you to grow into.
If you can't stomach the cost, fine. Get a free one. Recommendations:
- NotePad++ Windows only
- Vim Vim is a very powerful and feature rich editor, but it comes with a high learning curve. Consider yourself warned. That said, many have learned and come to love it.
- TextWrangler Mac only
These aren't the only good free ones out there, they're just the ones that I've used at one time or another.
###The Latest Version of WordPress
Go to wordpress.org and download the latest version onto your machine. I'd recommend setting up folder on your machine called "Wordpress_Versions" and download into that. That way, as you start new projects later, you'll have all your WP downloads all in the same place, each named according to its version.
In order to get WordPress doing its thing locally, you're going to need a local web server running on your machine. You'll need the ability to run PHP (PHP is one of the many computer languages that can be configured to run on a server as part of a web application; it's the one used by WordPress). You'll also need a database (a MySQL database, to be precise).
It's easier than it sounds to get these three things up and running on your machine. Thanks to the awesome community of open source software developers who have made it easy for us.
MAMP: Mac, Apache, MySQL, PHP: Simple Installer
WAMP: Windows, Apache, MySQL, PHP: Simple Installer
LAMP: Linux, Apache, MySQL, PHP: If you're using Linux, you're probably able to install each of the components on your own. If you're feeling lazy and just want to get started, google for "install LAMP in one command line" include your Linux distribution name as well.
If you're rolling your own LAMP stack, you'll probably want to install (phpMyAdmin)[http://www.phpmyadmin.net/home_page/index.php] to help manage your MySQL databases. MAMP and WAMP should come with it installed already.
Once the *AMP components have been installed, you'll be the proud owner of your very own apache server. Congratulations! Take a quick jog over to the nearest mirror and give yourself a high-five.
The main thing you need to know to get started making web pages is: where is the document root? That is, where is the folder in which you can put files that will get served up to your browser when you point it at http://localhost:(whatever-port-your-server-is-serving-to)?
With MAMP (and I presume WAMP), you can set the document root manually by clicking Preferences > Apache. I'm pretty sure the default LAMP (well, pretty much the default Apache) configuration is /var/www. More info here. You can change it using the DocumentRoot directive (search "DocumentRoot Directive" here for more info).
Git is a version control system that will serve you nicely as you begin tinkering around with various projects. If you have no idea what I'm talking about when I say "version control", it's time to learn-up!
Download Git, then learn a bit more about it.
###A GitHub Account
GitHub is a place of magic and wonder, and you need to be a part of it. It's pretty much the place for storing, viewing, using, and collaborating on open-source code. It can also become the place where you keep your proprietary code as well, but you'll need to upgrade to a paid account for that.
But the main reason you'll want a GitHub account right now is because you'll want to use (and perhaps enhance) my WordPress starter kit which I have on there.
Less is a beautiful way to write CSS (and less of it). We'll talk about that later. For now, all you need to know is that you can download a program that will automatically watch and live-compile *.less files to *.css files. Grab the version appropriate to your OS: