WP multisite and child themes for subdomains

This topic has 10 replies, 2 voices, and was last updated 8 years, 5 months ago ago by Olga Barlow

  • Avatar: nfinance2
    nfinance2
    Participant
    July 21, 2016 at 08:21

    I have been setting up my site using category password protect plugin so I can have private stores for specific customer groups with their own custom product but it has not been working like we had hoped. My host suggested switching to multisite WP and creating subdomains based off of the main domain that would serve as those private stores and enabling a password for those subdomains. If I go this route, how do I go about using the child theme for each subdomain and being able to make changes to each one of those subdomain/child themes so the changes stay with each child theme only? I have already created a child theme for mainsite.com. Now all the subdomains will be store1.mainsite.com, store2.mainsite.com, store3.mainsite.com etc. All of those subdomain stores will be a watered down version of the main site with only a home page and shop page with a few changes such as colors and slider content and of course product will be different. I want to create the first one (store1.mainsite.com) and be able to use that altered child theme as a template for all the other store subdomains without having to remove all the content again that I don’t need from the mainsite. I am not sure how to activate a new child theme to each one of those subdomains so they are different in multisite WP. I don’t want to make a change in store1.mainsite.com and have it show up in store2.mainsite.com. I am assuming that I need to create child theme folders each with a unique name and upload and activate for each subdomain? What other changes would I have to make if this is the correct way to do this? Do I need to change anything in my directory folders? Or, is this not the way to do this and I should be doing something different?

    9 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 21, 2016 at 09:07

    Hello,

    If you have multisite and need a few child themes to activate another one for every separate site you can copy your xstore-child folder and call it xstore-2-child, or similar. Then open up style.css in xstore-2-child, and edit the Theme Name:. Do this for as many different child themes you need.

    After that go to Network Admin > Themes > select Network enable for all you child themes. After that go to every site and enable child theme you need.

    Regards

    Avatar: nfinance2
    nfinance2
    Participant
    July 24, 2016 at 07:53

    I am understanding how to copy the child theme the way you are instructing however, this just gives me your generic child theme without my custom changes from the mainsite. I am wanting a copy of my mainsite child theme with all my custom changes in order to use it as a template for all my other subdomains.

    I was able to run a plugin called NS Cloner that did copy that site over to a test site I created within my WP multisite but if I use that cloner, I do not see where it creates a new folder for the copied child theme so I can change the name. When you go to the newly created subdomains admin and click on theme, it just says xstore-child theme which is the same as my mainsite and since it is multisite WP, If I edit the style.css in my network admin so I can make individual changes to each domain, it would apply to all sites using that child theme I believe?

    I don’t want that to happen as some features will be slightly different including products in each of these child themes. Of course there has to be a way to copy this working child theme so hoping you can tell me how.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 25, 2016 at 10:39

    Hello,

    Could you clarify your question? Because I’m not sure if understand you correctly.

    You can edit child theme style.css to add changes you need. Every child theme will have its own changes. That’s why all the sites will look different.
    If you need new child theme use default one from theme package and just change name, description etc. Then copy into themes folder on your sever using FTP. Or make an archive and upload via Dashboard.

    Regards

    Avatar: nfinance2
    nfinance2
    Participant
    July 25, 2016 at 11:01

    I have made a new child theme, as you can see in my admin and I now want that newly created child theme WITH ALL THE CUSTOM CHANGES THAT WERE MADE TO IT to be a template for my other subdomains. Please advice how to copy an existing and working xstore child theme.

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 25, 2016 at 11:15

    Hello,

    Connect to your server via FTP, download your child theme to your local machine. Change folder name and all the other necessary information. Upload this new child theme into themes folder. Go to Network > Themes > activate new child theme. Then activate it on your new site.

    To import theme options from one site to another go the Theme Options > Import/Export > Options > Export options (http://prntscr.com/bx7bqp) after that go to the same area at new site and Import options.

    Regards

    Avatar: nfinance2
    nfinance2
    Participant
    July 25, 2016 at 11:59

    Connect to your server via FTP, download your child theme to your local machine. Change folder name and all the other necessary information.

    I did try this and all I ended up with was the same blank child theme that is included with xstore theme. Are you saying go to cpanel-wp-content-themes- find theme folder, download to my PC? I did that as stated. I changed folder name. What are you referring to when saying to change “all the other necessary information”? I changed the theme name in style.css as well with new theme name.

    To import theme options from one site to another go the Theme Options > Import/Export > Options > Export options (http://prntscr.com/bx7bqp) after that go to the same area at new site and Import options.

    Are you saying that even if I copy my childtheme-2 off of my server, rename it and upload again to new subdomain that I will still have to export/import all of the theme options regardless?

    I was able to clone my maindomain site running on child theme using NS Cloner and it worked however, I do not see where a new theme folder is created after and now both sites are using the same child theme so not sure how I can rename that cloned child folder when it doesn’t appear to exist so it can have its own style.css fucntions.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 25, 2016 at 14:18

    Hello,

    I’m a little bit confused what effect you want to achieve.

    Theme (no matter child theme or parent) has 2 parts of styles: 1) Default styles from style.css and other included css files 2) Theme options that you can change according to your need – hover effects, colors, page/product layouts etc. If you want to create new site with its own styles you need to remember about these 2 things.

    So, if you want to create site with changes in Theme Options and CSS styles you should create child theme, activate and do all the changes you need there. If you want to create few sites that will use different styles for every site you need to create such many child themes as you need. If some parts or changes will be the same copy them into the necessary child theme. If you plan to use the same styles for all the additional sites – just activate the same child theme for every site. Every child theme has it’s own style.css and all the other files. If you made changes in child theme1 it won’t affect child theme2.

    The same for theme options. If you activate child theme you’ll get default theme options from parent theme. If you need to change some options – do this. It won’t affect main site where parent theme is enabled or any other site with child theme.

    Regards

    Avatar: nfinance2
    nfinance2
    Participant
    July 25, 2016 at 18:00

    I will just try the export options and import to each child theme as you are saying. What I wanted was to take the first child theme (child theme 1) and create a zip folder of this child theme which has all my custom options and just copy and rename that folder and then upload that custom child theme to the server for each new subdomain so they were ready to go.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 26, 2016 at 10:03

    Hello,

    I see. Ok. Let me know if you need any t=other assistance.

    Regards

  • Viewing 10 results - 1 through 10 (of 10 total)

The issue related to '‘WP multisite and child themes for subdomains’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.