Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have 15 different wordpress sites installed on my server. They are independent installations , not multisite. I have developed a parent theme and copied it in all sites. Now whenever I have to make a change in parent theme, I have to access parent theme of all sites and make changes in each theme. Is it possible that I can globalize this parent theme such that I do change on one place and it reflects on all 15 sites (Without using Multisite feature). Though I wrote a php script that copies parent theme in all sites but not satisfied since I have to call that script everytime.

share|improve this question
    
How would one stand-alone WordPress install know about another one? Why don't you want to use MultiSite, which would make your problem a non-issue? –  Chip Bennett Feb 26 '13 at 16:24
    
They gave me 15 stand alone wordpress sites to work. :( –  mysterious Feb 26 '13 at 16:27
1  
Then I would search the site for how to hook into the WordPress Update API, host the Theme somewhere yourself, and let the individual sites poll for updates. See this question, for example –  Chip Bennett Feb 26 '13 at 16:42
    
thanks. Will check it out. Can you make this comment your answer. I may consider accepting it :D. –  mysterious Feb 26 '13 at 16:47
add comment

2 Answers 2

Create a separate directory and a (sub) domain for your themes.
Lets say the domain is themes.example.com, and the directory is /extra/wp-themes/.

Now let all your installations use the new theme root. Or just do the same for plugins to manage all plugins from one place too.

Registering a new theme root is not possible with constants, you will need a plugin like this:

<?php
/* Plugin Name: Local Theme Roots */

add_filter( 'theme_root_uri', 't5_switch_theme_root' );
add_filter( 'theme_root',     't5_switch_theme_root' );

/**
 * Create a custom theme directory.
 *
 * @wp-hook theme_root
 * @wp-hook theme_root_uri
 * @author  Thomas Scholz, http://toscho.de
 * @param   string $in URL or path
 * @return  string
 */
function t5_switch_theme_root( $in )
{
    if ( 'theme_root_uri' === current_filter() )
        return "http://themes.example.com";

    // If we made it so far we are in the 'theme_root' filter.
    $new_root = '/extra/wp-themes';
    register_theme_directory( $new_root );
    return $new_root;
}

Be aware there is a bug in the WordPress’ theme updater that doesn’t let you update themes from the wordpress.org directory when you are using a custom theme directory. You have to run the updates for such themes either manually, or use my patch from Ticket #22501 until WordPress 3.6 is out.

share|improve this answer
add comment

Assuming you are on linux and all the sites are on one server you can use symbolic links

If your deployment location of the theme is /home/me/mytheme add an symbolic link in each site's theme directory to point to it

/home/site1/wp-content/themes/mytheme -> /home/me/mytheme

Once done every time apache will access the file /home/site1/wp-content/themes/mytheme/x.php the OS will load the file /home/me/mytheme/x.php, therefor a change in the /home/me/mytheme/x.php file will have an immediate impact in all of the sites.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.