Deleted Theme That Was Active On a Subsite

Hello,

We have a site using the theme Layers and now there is a theme with the exact same name in the theme repository. The incorrect Layers theme got activated on a site and I inadvertently deleted it while it active on a subsite. When I realized my foobar, I reinstalled the theme that had been active.

I am not proud to say that I have done this bone-headed thing before, but in those cases, restoring the deleted theme fixed everything. Not this time.

The site is white screened and I am unsure what I broke.

Editing the site via network admin reveals the proper theme name, etc.

Any advice would be appreciated.

  • Michelle Shull

    Hey there, SooBahk!

    No worries, we've all done a few bone-headed things in our day. :slight_smile:

    Do you still have one of the default WP themes installed on that subsite? If it can't find the theme assigned to it, it should default to one of the default themes. There are a few cases I've seen where this hasn't been the case, but changing the theme in the network settings for that site should allow you to get one of the Defaults working. From there, you should be able to reinstall and reactivate the missing theme.

    If you've deleted the default themes (don't do that in the future, if you have, they can come in handy, even if you only have one default available per site.) just download a fresh copy of the latest one, twenty fifteen, unzip it, and upload the theme folder to your wp-content/themes directory via FTP, then change the settings in network admin to point to it instead.

    Let me know if this doesn't work! And don't feel bad at all, I could tell you some stories of things I've done to my WordPress sites that would make you laugh and laugh. :slight_smile:

  • SooBahkDo

    Jut an update.

    It is worth noting that this site was created using WPMUDEV New Blog Templates. The source site had quite a number of active plugins on it.

    In this particular case it turns out there was an active and contrary plugin from the source template site that was causing the issue. Once I identified it and deactivated it, the site came back up and then I reactivated the plugin and all was fine.

    This is not the first time I have encountered an issue like this on a newly created site. It appears to be caused by some plugins not properly activating when the new site is created.

    In some cases it is plugins that create their own tables which fail to create those tables during site creation.

    A workaround seems to be to NOT create new sites with very many plugins active on the source template site, rather create the site with a minimum of active plugins and then activate the full set of plugins via some other means. Of course this defeats one of the time saving aspects of even using the WPMUDEV New Blog Templates plugin, but it is less of a pain than troubleshooting a site that is whitescreened.

  • SooBahkDo

    Unfortunately, I am unsure of the specific plugin as I deactivated and reactivated batches of 20+ plugins and while doing so, one batch operation restored site operation. I did not have time to dig further, but going forward when creating a site using new blog templates I think a better practice is to use a source site that has a minimum qty of basic function plugins active on it and after the site is created and accessible, THEN activate the remaining plugins.

    Some of the plugins that I have previously found that DO NOT like network activation (they work fine activated site by site, but not when network activated) and which DO NOT seem to like being activated by new blog templates include, but are not limited to:

    https://wordpress.org/plugins/wordpress-seo/
    https://wordpress.org/plugins/relevanssi/
    https://wordpress.org/plugins/yet-another-related-posts-plugin/
    https://wordpress.org/plugins/google-document-embedder/
    https://wordpress.org/plugins/post-type-switcher/
    https://wordpress.org/plugins/public-post-preview/
    https://wordpress.org/plugins/public-post-preview-configurator/

    These are all excellent plugins and they all work for us on multiple WP 4.2.1 networks on hundreds of sites; HOWEVER, some when initially activated need an initial save of their options before they will behave and work as expected. It appears that on at least one this initial save action is needed to creates tables the plugin uses. Others if activated network wide simply do not appear on individual sites, but when activated site-by-site, they appears as expected and all is well.

    All of these plugins and others will behave best when activated one at a time and configured individually. I find it best to deactivate them on any source site we plan to use with new blog templates to create new sites.

    Having these plugins (and some others) active on a source site that new blog templates uses to create a new site will only wreck havoc and the new site is unlikely to function. I have encountered this scenario multiple times; so many times in fact that I have almost abandoned using new blog templates because of the unexpected results encountered. It seems that is often costs me more time than it saves me due to the problems caused by "unusual behavior" of some plugins upon initial activation.

  • Ignacio

    Hi @SooBahkDo

    I'm sorry for the delay but I have been off for a few days.

    I'm afraid I don't fully understand what the issue is or what does it has to do with NBT.

    Usually, trying to "template" a site with many plugins activated can bring some issues that would need additional coding to solve, that's true, but is impossible to make NBT work with every plugin. Every plugin should be responsible to create the tables themselves if they have not been created. NBT offers the option to copy those tables though so everything should work once the copy is over. Otherwise, you can make use of the hooks that NBT offers and change stuff before/during/after the copy. If you manage to find out which plugin is failing then you can ask us and if the solution is not too hard, I could provide a piece of code for that :slight_smile:

    About the theme: NBT makes the copy but forgets about that site after that. If the Theme is deleted, NBT cannot know that. The solution is, well, do not delete the theme if is activated in any site. I know it sounds obvious but I cannot think about another thing.

    Regards.
    Ignacio.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.