WordPress.org

Ready to get started?Download WordPress

Forums

Make changes to a theme locally using WordPress Multisite (10 posts)

  1. Poole Windsurfing
    Member
    Posted 2 years ago #

    I am looking to use one WordPress theme for several sites using WordPress Multisite but want to be able to leave the original theme un-touched, whilst being able to edit the theme differently on each site (the theme being used is very flexible/editable & the various sites are completely un-related and need to look very different).

    Having read up a little, if I were to just activate the theme (WPRemix) on several of my sites within the WordPress Multisite system, then any modifications made to the theme would apply to each and every site using this theme. I can see that this fits with the idea of controlling/doing everything once from a single location in WordPress multisite BUT many (including myself) must want to use a theme as a 'template' which you can modify to the needs of websites you create that are completely different/requiring different layouts.

    What I want is to be able to use the original theme as a base/starting point for each new site I create within WordPress Multisite and then be able to edit the theme to suit each site's needs without changing the original or other sites version of the theme. Again, from reading up I have come across a couple of thoughts on the matter...

    1. Install a new copy of the theme (WPRemix) for each different website you create within WordPress multisite, renaming each copy (e.g. WPRemixSite1, WPRemixSite2, WPRemixSite3), then activate an instance of the theme in each WordPress site (Site1 will use theme WPREmixSite1, Site2 will use WPRemixSite2). A drawback of this approach would be that it kind of goes against the idea of holding everything in one place/only once within WordPress multisite and by having many copies of the theme you are adding bulk to your WordPress installation.

    2. Create a Child Theme of the original untouched WPRemix theme for each additional WordPress site you create. I don't know to much about this but believe it could do as per point 1 above without having to install entire multiple copies of the theme, rather just making local changes to the theme and pointing back to the main theme for the bulk of its content. My concern is that you could only use this option to make minor changes (e.g. different background colours, etc) rather than major changes to a theme and its files?

    If this IS an option to make major changes to a sites version of a theme then I would really appreciate some help explaining exactly how you go about doing this.

    3. Don't use WordPress multisite - stick to having separate single installs of WordPress for each site you create. Very straight forward, in the sense that each install of WordPress has its own version of the theme. Every website you create stands alone with no interference BUT it takes away all the great things about WordPress multisite: a single login for WordPress with access to ALL your websites, a single install of the WordPress files, shared plugins across multiple sites, updates for WordPress & plugins done just once from a single location!

    Any thoughts on how best to achieve having multiple WordPress sites using their own independently editable version of the same theme would be much appreciated.

  2. Depends what you want to change. CSS is easy (there's a plugin). Everything else, well, you should probably try to find a modular theme with different templates so people can pick and chose as they want. A good theme framework (Genesis, Hybrid, etc) will go a long way in that regard.

    Otherwise, I'd do option 2.

  3. Poole Windsurfing
    Member
    Posted 2 years ago #

    The theme I use is called WPRemix and it has a ton of templates that can be selected from within a WordPress page and used to customise the look & feel of any website you are creating.

    Having developed my first site using this theme I know that although the bulk of the sites style & layout are done by just selecting a template to base a page on but I also had to change lots of small things in core 'theme wide' .php & .css files to get the site looking how I wanted it. Is this not the case for all themes?

    For example, there are several header.php files to chose from so you can select how you want to top section of a website to look. Say I select header2.php for my first site, I must go into the file and modify what content it will display (e.g. company logo banner, contact details, what menu navigation will be displayed, etc). The problem with multisite would be that if I have gone in and altered these files (as you must to get a site how you want it), any other site you create within WordPress Multisite and want to base the header section on header2.php will have the same information (i.e. the wrong company logo banner, contact details & menu system)??

    Another example would be a general theme file that controls what ads are display on the blog page sidebar (blog_sidebar_ad.php) which you edit to include images you want to display. How can you then use the theme on another site without having the images for the first site still displayed?

    Is this not a problem with any theme you try to use in different sites within WordPress Multisite? That changing .php & .css files to suit the first site will mean all other sites you want to use the theme with will be using the same files that have content meant just for the first site you created?

    If this is the case I can only see option 1 working (multiple installs of the theme under different names, one for each site that you want to use the theme on). I was just hoping there would be a way to have just one install of the theme and manipulate each sites requirements from that 'master copy'.

  4. Changing a theme's MASTER files will change them for all sites.

    I would make a child theme for each site:

    site1-wpremix
    site2-wpremix

    And activate those child themes PER site. Uses fewer files, as you ONLY need to add files to your child theme that you want to overwrite.

    Honestly, what most of us do is ... neither. We use themes that let the sites edit as they want, within reason.

  5. Poole Windsurfing
    Member
    Posted 2 years ago #

    Thanks for replying again.

    If you make a child theme for each site with only the files you want to modify, how does that site access the rest of the themes files that it will need to function?

    The option you say most use: having a theme that lets the sites edit as they want, sounds great. I assume the editing is all done 'in house' on each individual site through various menu options in the WordPress interface BUT with a very powerful/customisable theme such as WPRemix is it not always the case that you are going to need to alter 'core' theme files to get the look/functions you want for a site?

    Thanks again for your help so far, I am just trying to get my head around the various options before making the leap to WordPress Multisite and I am so familiar with the WPRemix theme it would be a shame not to be able to continue using it for my future sites.

  6. You need to go read about how child themes work.

    http://codex.wordpress.org/Child_Themes

    A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme.

    Hand to FSM, that's what you need :) Child Themes are freakin' awesome.

    The option you say most use: having a theme that lets the sites edit as they want, sounds great. I assume the editing is all done 'in house' on each individual site through various menu options in the WordPress interface BUT with a very powerful/customisable theme such as WPRemix is it not always the case that you are going to need to alter 'core' theme files to get the look/functions you want for a site?

    Honestly ... No. Every theme I use has three options

    1) Functions (which is what I like to do, I like coding)
    2) Plugins to modify things instead of using functions (i.e. they ovverride on a per site basis)
    3) Built in Theme Settings

    Like I said, a really good Theme Framework can do that out of the box. If it's powerful and customizable, it should have a back end, site segregated, way to do that.

    Check out Genesis and Theme Hybrid.

  7. Poole Windsurfing
    Member
    Posted 2 years ago #

    Interesting that you say it is possible to have a theme that can 'site segregate' out of the box. I put this to the forum admins of my plugin WPRemix and they had this to say...

    "I do not see how a theme can be installed as a single instance and network activated and yet maintain it's own customizations within each sub-domain of a multi-site WordPress install."

    I have to admit that I still can't really see how it is possible to have a centrally activated theme for which you can tweak the code without affecting any of the other sites using the same central theme? (apart from the child theme idea - which seems to be limited to .css file alterations, not for changing .php files). I may be wrong about this as I admit to not really knowing a lot when it comes to themes & WordPress Multisite, hence all the questions! (sorry).

  8. "I do not see how a theme can be installed as a single instance and network activated and yet maintain it's own customizations within each sub-domain of a multi-site WordPress install."

    Well. Twenty Ten an Twenty Eleven do it. Genesis, ThemeHybrid, and pretty much every thing in the WP Repository can do it too.

    It's so easy you'll laugh. See they store settings in wp_options. Which Multisite is clever enough to flip to wp_2_options or wp_3_options, depending on which site you're on.

    That's it :) Magic!

    ETA: There are two kinds of theme 'customizations' remember.

    1) Editing the theme directly (or making a child theme)
    2) Using the built in theme options.

    #2 is what uses wp_options :)

  9. Poole Windsurfing
    Member
    Posted 2 years ago #

    I understand what you say about Multisite switching between wp_options depending on what site you are using and that this works for built in theme options but to compare it to what I would like to do...

    My theme (WPRemix) has over 45 different page templates selectable when you are creating a new page in WordPress. If all I wanted was to have Multisite recognise a template used for a page within a site compared to another page template used in a different site then the wp-options works fine.

    The problem is I don't just want to be able to select different page templates for different sites, I actually want to be able to go in and alter the coding files associated with the theme or called upon by these page templates. With just 1 instance of the theme, if I alter these files, every site using the same theme will show the same changes.

    Having taken your advice and read up on Child Themes it seems that it would be a lot of work to setup a child theme for each site I create (style.css, functions.php, referencing child .css files with get_stylesheet_directory(), using template files to replace parent files). If I am changing lots of the themes files is it not more hassle to go through the whole process of setting up & maintaining a Child Theme structure compared to just installing multiple instances of the theme with different name variations, 1 for each site I create? A lot of people seem to be taking this approach to using a theme for several sites within WordPress Multisite.

    Still appreciating your input & I am learning a lot from it - thanks

  10. If I am changing lots of the themes files is it not more hassle to go through the whole process of setting up & maintaining a Child Theme structure compared to just installing multiple instances of the theme with different name variations, 1 for each site I create?

    Let me put this another way.

    Is it more effort to duplicate a MASTER theme, and have to MANUALLY, line by line, update 100 child themes if the master updates ... or to just use a child theme, ONLY changing the files you want to change, and leave the master alone?

    That said, if you're in a situation when you feel you have to make a ton of changes per site to the THEME, you're using a crap theme for your use-case.

    We keep going over this, so I'm goning to say this one last time, and then ignore you every time you belabor the point: Yes, if you change the master theme it changes it for everyone who uses that theme.

    We get it. We KNOW. That's why you should make children themes.

    The problem is I don't just want to be able to select different page templates for different sites, I actually want to be able to go in and alter the coding files associated with the theme or called upon by these page templates.

    Then you're using the wrong theme. The theme doesn't meet ALL your needs. Put it down and look for another one. Or write your own. But the day you find yourself making a million little changes is the day you've got the wrong theme.

Topic Closed

This topic has been closed to new replies.

About this Topic