• Resolved tecombs

    (@tecombs)


    I’m curious to know, because I’ve tried it and failed, if it is possible to momentarily stop working on one site project/theme and then activate another theme within WP.

    I was driven to install WAMP and WP on my other computer to work on another site.

    Is it possible, as we do with other editors, to just ‘close’ one and then ‘open’ another? I take it that it just can’t be that simple.

    TIA,
    Dave

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello Dave,

    If I understand your question correctly, the answer is ‘yes, no problem at all’…

    I am assuming that you want to work with several sites on a single computer that already has a WAMP stack installed. I am also going to assume that you know your way around your computer because it sounds like you are already doing web project development of some kind.

    In the Famous 5-minute Install, in step 1 you unzip into a folder within your www folder (or wherever the WAMP server looks for the files to serve). If you want to have two sites, which I will unoriginally call siteone and sitetwo, you unzip WordPress once into www/siteone/ and a second time into /www/sitetwo/. (Actually, when you unzip it you get a folder called ‘wordpress’. You make one copy and rename it ‘siteone’ in your ‘www’ folder, and then you make a second copy and rename it to ‘sitetwo’, also in your ‘www’ folder. Or you can download and unzip it twice, renaming one ‘wordpress’ folder to ‘siteone’ and the other to ‘sitetwo’, both within the ‘www’ folder. I hope you get the idea.)

    Next, in step 2 of the Famous 5-minute Install, you create two new databases in MySQL, one called ‘siteone’ and the other ‘sitetwo’.

    Step 3 is generally unnecessary these days, and step 4 doesn’t really apply if you are running within a localhost development environment and already have the files in your WAMP server’s www (or whatever) folder.

    Finally, in step 5, you connect first to ‘https://localhost/siteone/’ and follow the installation instructions until everything is up and running. Then, you connect to ‘https://localhost/sitetwo/’ and follow the same installation instructions, this time indicating that the database name is ‘sitetwo’ instead of ‘siteone’. The WordPress installer will take care of pretty much everything else, including to set things up to look for each site within the appropriate subfolder of your WAMP’s www folder.

    Not only can you then switch back and forth from one site/project to another by signing out of one and signing in to the other, you can even have both of them open at the same time in separate tabs in your browser.

    As for switching between themes, they are stored within each site separately, so the themes in www/siteone/wp-content/themes/ and those in www/sitetwo/wp-content/themes/ are completely independent of one another. Moreover, you can freely switch from one theme to another at any time by activating the new one in the dashboard. Content is stored in the database and is independent of the theme. The theme’s job is to retrieve content from the database, lay it out and send it to the browser, not to generate the content.

    The plugins are also independent of the theme, so any plugins will remain the same when you switch from one theme to another. Of course, if the newly activated theme does not support something that a plugin provides it might not show up on your site until you switch to a theme that does support it.

    Returning after all that to your original question, yes, if you set things up to do so, it is pretty much as simple as using multiple windows/buffers in a text editor. I often find myself looking at two different development sites (typically for comparison) in separate tabs, often in several different browsers, at the same time. The only trick (if you could call it a trick at all) is to have two or more complete WordPress folders, one for each site/project, and two or more separate databases, one for each site/project, then to talk to them via ‘https://localhost/siteone/’ and ‘https://localhost/sitetwo/’ from your browser.

    Apologies for making this as long as it is, but I do hope it helps.

    Happy WordPressing,
    Eric

    Please excuse me for joining in here, but, wow, Eric, that was an extremely clear and ever so useful description you provided here! Thank you very much indeed!

    Have a nice weekend,
    Flower33

    Thread Starter tecombs

    (@tecombs)

    I’m sorry for not closing this. I replied to the email I received thinking it would get to you.

    So, thank you, Eric. I appreciate this and will try it ASAP.

    It wasn’t too long at all.

    The only trick (if you could call it a trick at all) is to have two or more complete WordPress folders, one for each site/project, and two or more separate databases, one for each site/project, then to talk to them via ‘https://localhost/siteone/’ and ‘https://localhost/sitetwo/’ from your browser.

    I do something similar but with only one WordPress installation by making a quick edit to wp-config.php to switch from one set of database tables to another.

    /* site1 /*toggle on/off*
    $table_prefix='wp1_';
    /* site2 /*toggle on/off*/
    $table_prefix='wp2_';
    /* site3 /*toggle on/off*
    $table_prefix='wp3_';
    /*-*/

    Thread Starter tecombs

    (@tecombs)

    That’s interesting. Apparently you can make PHP do most anything. I’ll add that to what the other guy added earlier in the week.

    Thank You Eric!

    Still works – easy and useful.

    Cheers,
    mrbubble

    So are you able to do 2 wordpress websites on the same computer? Are they on the same server? I have to log in and out of each one. I downloaded Wp on my mac for one site but recently have to do another site so I downloaded wp on my hp.I hate my hp and prefer to do everything on my mac so i saw that i can sign in and out but what about the server space?

    Thread Starter tecombs

    (@tecombs)

    sseler,

    For what it is worth.

    ECUK’s point was to have more than one copy of wordpress within the wamp/www folder. I currently have 3 copies of wp, all appended with 0, 1, etc., there but have not had need to use what those above have recommended. One would have to sign out of one working copy into another (wordpress, wordpress_0, wordpress_x).

    But I may have need to do in the future when I upgrade my site again.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Working with several sites in one WP installation’ is closed to new replies.