views:

382

answers:

3

I have two WordPress blogs running on the same server, so they both have access to the same file system. Both blogs use the same template, and this template is duplicated within each theme directory. Every time that I update the theme I need to copy over the new files to both theme directories.

Is it possible to have both of these blog share a common theme directory so that I only need to modify one template folder?

+2  A: 

You can have a symlink link one theme folder to another.

delete one of the theme folders and use ln like cp

ln -s <source> <dest>
+2  A: 

Absolutely. Just make sure that they have read and write access to that shared folder.

Then set up a symlink from each of the theme folders. You do this with ln -s

If you can't use symbolic links, you can then set up a rewrite-rule, which redirects all requests from /wp-content/themes to like /var/www/shared/themes.

If you want, I can provide an example.

alexn
Thanks! Luckily for once I am not on a windows server. Nevertheless, would there be a way to share a template directory on a Windows server?
@webdevbytes: Personally, I use blog hive, which lets two wordpress blogs share a wordpress install, rather than just a theme directory. In essence, it translates all database lookups so that, depending on the host header, a different set of tables are used to look up blog data. As for mimicking alex's rewrite rule strategy, you might be able to use virtual directories on IIS to accomplish the same thing, though you *can* use rewrite rules in IIS if you install an add-on for it like Helicon . I think IIS7 has some native rewrite stuff.
Brian
A: 

Another approach, if using source control (SVN, Git), would be to checkout the theme into the two locations and update them.

Devin Reams