Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

patrick tagliaferro
patrick tagliaferro
5,399 Points

Local Dev - Multiple sites, 1 WP install

I have a folder called Sites that house all my WordPress sites I develop locally for clients. Obviously MAMP just runs through the "Sites" folder so I can view them offline and each has their own database.

Is there a way to just have 1 WordPress install somewhere? I know each site would need its own wp-config.php file to point to its database and its own wp-content folder to hold themes/plugins for the site. Wasn't sure if I could have some file in say "sites/examplesite/" that would point to the WP install so in the "sites/examplesite/" folder all I need is wp-config.php and the wp-contents, all the other core files/folders would be found separately.

Hope that makes sense.

Cheers!

2 Answers

Andrew Cato
Andrew Cato
4,263 Points

According to the codex, this isn't possible.

Brian Hayes
Brian Hayes
20,986 Points

It sounds to me like you are simply looking for an easy way to install a new WordPress site locally. I originally used MAMP for developing locally, but going through the process of creating new installs was tiresome.

Now for local development I use VirtualBox and Vagrant all configured by Varying Vagrant Vagrants.

Using VVV and an addon for easy site creation called Variable VVV I can simply type:

vv create

in the terminal and I can quickly go through the site creation process by going through a few options, such as site name, domain name, whether or not to clone a repository into wp-content, whether or not to import demo content for testing purposes, and so on. The script then does all the work of downloading WordPress, creating a database, updating your hosts file, and getting the site up and running.

This will force you to get a bit more comfortable with the command line if you aren't already, but I've found that I've ended up really improving my ability as a developer by doing so, thus I can't complain. This option is also free.

A GUI alternative would be something like DesktopServer. I've never used it myself, but people must be using it for a reason. This, however, will cost you some cash, but probably has a much lower learning curve.

Good luck, and I hope this helped a bit!