WordPress.org

Ready to get started?Download WordPress

Forums

Need to have single themes folder for many blogs (21 posts)

  1. danielt
    Member
    Posted 6 years ago #

    I have searched and searched, both WordPress forum as well as googling this... the only results are people asking the same question but nobody has yet answered.

    I am going to have a few blogs on various subdomains and I typically find myself customizing the theme files for various reasons. I modify the templates locally so I will have what I want prepared for upload to any given blog. But this is so wasteful as I then have to upload the theme several times, and aside from that of course there are many copies of the same files just to have them on each blog!

    I want to have ONE folder containing the theme templates where WP looks when it lets me peruse my available themes.

    I figured I'd have to change a parameter somewhere for exmaple called "themes_folder=" or something like that, where I could use a URL to direct it where to look. Is this possible? It is very frustrating to have to modify the template and upload it several times to different locations all the same files. I not only spend more time doing this chore, but use up more space on my host.

    Any solution?

  2. Chris_K
    Member
    Posted 6 years ago #

    Now now, themes don't take up much space! :-)

    I don't have the answer either... How much access do you have on your server? I wonder if symlinks would work?

  3. danielt
    Member
    Posted 6 years ago #

    The disk space isn't even the more crucial problem. It is that I find myself wanting to modify a theme's structure or some of the built-in content... the more blogs I run (which will increase over time), the more locations I would have to update with that theme. Add to that the fact that I may want to swap around themes now and then, so I would have each theme having to go in each location... of course, I wouldn't have a science-oriented theme NEED to go in the folder for a blog about food, but in general, the themes would all have to be kept up to date. It becomes a nuisance.

    I really hope this is resolvable.

  4. Chris_K
    Member
    Posted 6 years ago #

    You didn't mention this part from my previous post:

    How much access do you have on your server? I wonder if symlinks would work?

  5. danielt
    Member
    Posted 6 years ago #

    I am the administrator of my site and I have complete access to the domain, all folders, files, and privileges.

    Please describe a method you'd recommend and I can test it as I'm now creating a blog site.

    Thanks

  6. danielt
    Member
    Posted 6 years ago #

    Is there NO internal reference which tells the system where to look for themes? Is the ./wp-content/themes path hard-coded into the system? One would think that was a variable that was modifiable.

  7. whooami
    Member
    Posted 6 years ago #

    I am the administrator of my site and I have complete access to the domain, all folders, files, and privileges.

    thats still not clear :) really.. are you root? Doing your own hosting, colocating a box, doing something like that.. are you thats what he is asking..

  8. danielt
    Member
    Posted 6 years ago #

    I am not sure what you mean, am I root? The domain is mine, and I have all access to everything in the domain's folder. In addition, I can modify file and folder privileges, create and remove domain objects, etc.

    It would help if you asked me "can you do xxx," for example. This way I would be able to get a definitive answer for you.

  9. whooami
    Member
    Posted 6 years ago #

    your site is hosted somewhere (evidenced by your last answer) ..

  10. Chris_K
    Member
    Posted 6 years ago #

    Can you create a symlink? It typically takes root access.

    http://en.wikipedia.org/wiki/Symbolic_link

  11. whooami
    Member
    Posted 6 years ago #

    not to confuse matters, but being able to create a symlink doesnt make you root. As long as own the files, you can do that, on some setups. I can, for instance, on aso, and I am by no means, root.

    Again, not to confuse matters, just dont want someone thinking their root when theyre not. :P

  12. Chris_K
    Member
    Posted 6 years ago #

    That's why I like to use "weasel" words like "typically". :-)

  13. danielt
    Member
    Posted 6 years ago #

    Ok I understand what a symlink is, I remember setting them up in a UNIX shell I used to operate. It is sort of a windows "shortcut" without intending to insult it by relating the two. For example on my FTP server where clients connect, I have some "links" which, if they click on, will take them to another location, but those can be accessed via the command "CD xxx" just like a directory.

    Therefore, if you mean that I should create my themes folder wherever I want it, then create a "symlink" with the name "themes" within the wp-content folder, and the blog engine will simply tunnel through that symlink, then I will get to work on that.

    Is this the course of action you mean?

  14. Chris_K
    Member
    Posted 6 years ago #

    More or less, yep. I've never tried it, which is why I was wondering if it would work in my earlier response.

    Seems like it would save a lot of time once the links were setup though. One master set of files to edit and all the blogs would get those changes in real-time.

  15. danielt
    Member
    Posted 6 years ago #

    Ok then I'm about to go looking to see if and how I can set it up. Will post results.

    Thanks so much.

  16. danielt
    Member
    Posted 6 years ago #

    My site management system actually has an option to turn on or off symbolic links for any given domain!

    However, now I'm really bashing my head trying to figure out how to make a symbolic link.

    Here's the setup
    mysite.com/myblog/index.php
    mysite.com/myblog/mywordpressfolder

    (I found documentation on changing the folder of all the engine material, and this works fine... just changed the reference in index.php)

    I have MOVED the themes folder from wp-content/themes to
    mysite.com/blogthemes/themes

    Now, I assume my symlink must be within the actual wp-content folder, and be called "themes"
    Is this a correct assumption?
    Now, what exactly would this contain?
    I have tried many ways to reference the actual location but I'm a dummy so I've just been trying things like
    ../../ and also from the complete root of my site. None of these things has worked and I suspect I'm doing it totally wrong.

    Please tell me what the file should contain, using the references I gave you.

    Just to let you know in case this matters, the real real path to my site is something like
    /<hostreference>/local/home/username/mysite.com

    Thanks for the help, please put me on the right path!

  17. danielt
    Member
    Posted 6 years ago #

    My site host is making me insane with crontab scripts and things I completely don't understand, and since their support is probably somewhere on the moon, they're not making much sense.

    Is the location of the themes a variable that can be modified anywhere in any of the configuration files? or is it hard coded and always needs to be wp-content/themes?

  18. Chris_K
    Member
    Posted 6 years ago #

    Themes pretty much need to be in w-content/themes.

    Your host might be suggesting putting together a script that copys/syncs one theme directory to all the others. You could then use cron to run that periodically. Not a terrible idea either.

    As for the symlinks thing, perhaps this might offer a bit more: http://en.wikipedia.org/wiki/Ln_%28Unix%29

    And thats about as far as I can go with that topic here... we've drifted rather far afield from it being a WP issue. :-) However, a bit of googling or some other sysadmin boards may help you suss out a way to use symlinks.

  19. Root
    Member
    Posted 6 years ago #

    Gotta say I am just mildly curious as to why anyone wants to be doing this anyway. If the OP is not root he is not admin. But in these circumstances I would use a script. Only way I would think except WPMU ?

  20. danielt
    Member
    Posted 6 years ago #

    At this point I am giving up. I'm not a web programmer... my host gave me this set of commands, but I would have no idea where they have to be inserted - into what file(s), so that in the administration utility of my blog it would read the proper location of the themes.

    I thank you for all your help thus far. Sometimes it ends up not trying to do something you want to do, because to do it will drive you nuts!

    Perhaps one of these days I'll get a friend to help me, I might know someone who knows someone... etc.

    Thanks, again.

  21. kdeathboo
    Member
    Posted 6 years ago #

    Anybody tried to make it so you make a php include in your "sub" theme to call the "main" template in a central folder?

    Like you have three blogs: A, B, and C, and one main template located in the folder mydomain.com/themes/

    Now, for blog A, you make a theme with nothing more in it than includes calling for the main theme files. For exemple, in index.php, instead of putting <?php get_header(); ?> , you put <?php include mydomain.com/themes/header.php ?>.. and so on for every file..

    Would this work? Just an idea though... if someone tried it, let us know!

Topic Closed

This topic has been closed to new replies.

About this Topic