Okay.
Some background info for you…
There are two parts to a wordpress site – the wordpress php framework (presents the information from the database as webpages), and the database (stores all the content and settings).
The way developers do what you are describing above is to have a production environment (the “final” version that visitors see), and the development/test environment (where you can experiment, test, and develop new features without compromising the production environment). So you need two different versions of the wordpress files and the database. Many plugins create new tables and make new entries in the database, so things will be much cleaner if you have the development and production database separated.
The Database
You can either create 2 separate databases, or use the same database with two different table prefixes. If you use the same database with two different table prefixes, you need to edit the file
“wp-config.php”. Find this block of code…
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
I would recommend sticking with the default for your production site, but for your development site, change it something like..
$table_prefix = 'wpdev_';
Here is a sort of step-wise procedure for you. I’m guessing you may have to do some research for each step, but that is how you learn (chunk by chunk).
1) Create the subdomain on your webserver. You are probably using a hosted solution, so use the control panel interface to do this. If you don’t know how, consult the tech support of your web host or do web searches for help.
2) Copy your production wordpress files (everything in the folder “wordpress”) to the subdomain directory.
3) Edit the wp-config.php file that is now in the subdomain directory as I instructed above. (If you go the 2 database route then you’ll need to edit the database authentication credentials in this file accordingly and you can leave the table prefix as the default).
Now you have a separate development and production environment.