Using Thesis Theme With A WordPress Multisite Installation

The new WordPress v3.0 is bringing in the multisite functionality of WordPress Mu. Here’s a quick tutorial on how to get the Thesis WordPress Theme working on such a WordPress multisite network.

  1. Install Thesis as you normally would on a WordPress site.
  2. Find the functions.php file under the Thesis folder and make the following changes:
    • Add $blog = strtolower(str_replace( " ","-",get_bloginfo('name') )); before the // Define directory constants line. This will make sure that the code we are going to add will pickup the right path.
    • Change define('THESIS_CUSTOM', TEMPLATEPATH . '/custom'); to define('THESIS_CUSTOM', TEMPLATEPATH . '/custom/'.$blog);. This will make sure that Thesis looks for the custom folder in a new site specific location.  (Update: See comment 9 for a more foolproof way of doing this. Thanks to Philip.)
    • Change define('THESIS_CUSTOM_FOLDER', get_bloginfo('template_url') . '/custom'); to define('THESIS_CUSTOM_FOLDER', get_bloginfo('template_url') . '/custom/' . $blog);. Does the same as above.
  3. For every new site that you create from the WordPress multisite installation you’ll have to do the following steps to make sure Thesis works for the new site:
    1. Navigate to the Thesis “custom” folder on the server. Create a new folder inside the server. Name it to the title of your new site. Eg. if the name of your new site is test then name the folder test. If the name is Test One, name it test-one (i.e. spaces in the name should be replaced by hyphen and the folder name should all be in lowercase).
    2. Upload the contents of Thesis custom folder into this new folder. As an example the path of the files will now be as follows (if your primary site is named Site and secondary is named Site Two):
      • thesis/custom/<site>/custom.css
      • thesis/custom/<site>/custom_functions.php
      • thesis/custom/<site>/layout.css
      • thesis/custom/<site>/cache/
      • thesis/custom/<site>/images/
      • thesis/custom/<site>/rotator/
      • thesis/custom/<site-two>/custom.css
      • thesis/custom/<site-two>/custom_functions.php
      • thesis/custom/<site-two>/layout.css
      • thesis/custom/<site-two>/cache/
      • thesis/custom/<site-two>/images/
      • thesis/custom/<site-two>/rotator/
    3. Set the permissions of layout.css to 666
    4. Set the permissions of cache folder to 775.

Now you can activate Thesis on the primary and secondary site. This will make that the functionality of custom.css, custom_functions.css and the site layout (Thesis Design Options) and other Thesis settings are unique for every site in the network.

The next time you upgrade thesis, make sure that you upload newly included files inside the custom folder to the server (no need to upload the files already on the server). Do this for every site that is a part of the network. Additionally you’ll have to re-upload functions.php file and make these changes to the 3 lines every time you upgrade.

Update: Seems like they’ve taken a clue and included these instructions on the official site.

 

Join 37,807 others and get free tutorials & tips on design & development using Wordpress on Thesis & Genesis!

Need help with Wordpress, Thesis or Genesis?

Are you a designer or a developer looking for a hand with Wordpress, Thesis or Genesis? Or perhaps want to save time with a project? Get in touch and let's get the ball rolling! Check out our Thesis development, PSD to Thesis & other services.

Comments on "Using Thesis Theme With A WordPress Multisite Installation"

  1. says

    I am planning to use both WordPress 3.0 and Thesis newly .. I have Thesis 1.7 single user licence. Can I you use that with WordPress 3.0 ?

  2. says

    Thesis is not officially updated for WordPress 3.0. You can however use Thesis with WordPress 3.0 as long as you adhere to it’s license and terms and conditions.

  3. says

    I am using Thesis 1.7 stable and made those changes that you called for on a test site that I have (after realizing that any design changes that I would make otherwise would affect all subdomain blog sites), but I am getting an error. Does this change only work for those using directories instead of subdomains for the multi-site option?

    Here is an added situation… the site that I am testing on has WordPress 3.0 running on the top-level of the domain (http://www.domainname.com) with two instances of blog sites running on subdomains (http://test.domainname.com and http://test1.domainname.com), so I tried your method in two ways…

    I first created new folders, test and test1. I copied all of the contents from the custom folder and placed them within each of the above while maintaining the normal copy of those files within the custom folder. (That created an error… stating that I needed to update the permissions of layout.css to 666… something that I already did for all copies.)

    I then did the same thing as the above but instead named each folder after the Blogname (Testing and Testing1). I got the same result.

    Lastly, I tried both of the above methods while putting the top-level domain copies into a separate folder (hence, under the custom folder, I would then just have 3 subfolders… one for each subdomain with all files inside while still following every detail of your instructions. Those trials turned out not to work… so, now I am stuck, trying to test this all out before implementing it on my personal blog site!

    Recommendations?

  4. says

    Dwayne: You will have to check the values of $blog and get_bloginfo(‘template_url’). In all possibility your custom.php and custom.css files aren’t being read by the blog/Thesis, thus this error. Please mention the values of these two entities and provide the url of two blogs and I can check it out.

  5. says

    I just looked you up on Twitter and followed you (please follow me so I can DM you a link to the option that I found that worked inside of the Thesis Forums)… I assume that you are also a Thesis subscriber (from what I seen in the member directory).

    I just made a few other adjustments, and the fix works well… so far! I hope to chat more soon… thanks for sharing your insight – it has been of great assistance!

  6. cs says

    followed everything above exactly and the public sites display properly, however…

    1. in the parent of the network, the thesis admin options page is not formatted (reference to a css file missing or invalid?), and…
    2. in child blogs the thesis control option is not even shown in the dashboard menu. clicking the “site options” or “design options” from the theme description in the theme manager only reloads the dashboard.

    anyone have a similar experience or idea on a fix?

  7. says

    A good scheme; it works. I tried it with Thesis 1.8b1, and it works the same… header images may now be different.

    One thing that I did change was that I used site id, rather than blog name – here’s how – include:
    global $wpbd;
    at the top of the functions.php file.

    Omit the code line that defines $blog (first code snippet above).
    Include $wpbd->blogid instead of $blog for each of the other two code snippets.

    The directories are now numbered (1 is your root, 2 the first MU site, etc). The benefit is that you can rename a site without breaking its themes.

  8. says

    Hi Philip,

    Where exactly do you insert global $wpbd; ?
    Just above // Define directory constants in functions.php?

    I tried to add that but have error. Thanks

  9. David Broome says

    Hello,

    How should the two lines be … this doesn’t see to do it..

    define(‘THESIS_CUSTOM’, TEMPLATEPATH . ‘/custom-’ . $wpbd->blogid);
    define(‘THESIS_CUSTOM_FOLDER’, get_bloginfo(‘template_url’) . ‘/custom-’ . $wpbd->blogid); #wp

    the custom folder is named ‘custom-’.

    This seems like a great way to allow thesis on WP3 multi-sites and the root site.

  10. David Broome says

    I tried this layout using ./custom/blogID and it works nicely. I was trying to to ./custom-blogID.

    FYI the working lines are:

    define(‘THESIS_CUSTOM’, TEMPLATEPATH . ‘/custom/’ . $wpbd->blogid );
    define(‘THESIS_CUSTOM_FOLDER’, get_bloginfo(‘template_url’) . ‘/custom/’ . $wpbd->blogid ); #wp

  11. David Broome says

    FYI another nice variable to use is “$blog_id” included in the php via “global $blog_id;”

  12. Robert says

    Not sure if this is how the behavior is supposed to operate but I am getting undesirable results. When I make a design layout change using Thesis’s backend design options on one site it reflects on the other sub site despite doing all of the above. Now I enabled using thesis as a single theme throughout the 2 sites, I’ll assume that if i duplicated the thesis theme and used it separately I wouldn’t run into this issue but I was under the impression that the above method would remedy this, can someone please advise?

  13. David Broome says

    It should. Can you review your set-up. I have seen people forget to copy the custom-default folder into the ‘custom’ folder based either on the blog_title or blog_id, depending on the way you implemented it. You could look at the web server logs to see if it is referring to the correct location. Do you want to layout your modification and see if someone sees an issue.

  14. says

    Correction!!! … to Philip’s suggestion. wpdb is mispelled as wpbd. Please read it as follows:

    here’s how – include:
    global $wpdb;
    at the top of the functions.php file.

    Omit the code line that defines $blog (first code snippet above).
    Include $wpdb->blogid instead of $blog for each of the other two code snippets.

  15. Robert says

    I eventually figured out that I had to put folders inside of custom, such as 1 or 2 and that long site names with spaces was messing me up so I thought it would be easier by ID although that can be confusing too, wondering if there is an easier way around this.

  16. ape says

    Someone also recommended to change the lib/scripts/thumb.php to:

    $cache_dir = ‘../../custom-’.basename(get_bloginfo(‘url’)).’/cache’;

    How would that translate if you would go for the blogid variant?

  17. ape says

    Thanks. Tried the blogid variant with Thesis 1.8. I gave the subdomains a folder under thesis_18/custom for example: thesis_18/custom/1 and thesis_18/custom/2

    But I get this error:
    Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in wp-content/themes/thesis_18/functions.php on line 15

    This is the changed functions.php code I use:
    blogid);

    // Define folder constants
    define(‘THESIS_CSS_FOLDER’, get_bloginfo(‘template_url’) . ‘/lib/css’); #wp
    define(‘THESIS_SCRIPTS_FOLDER’, get_bloginfo(‘template_url’) . ‘/lib/scripts’); #wp
    define(‘THESIS_IMAGES_FOLDER’, get_bloginfo(‘template_url’) . ‘/lib/images’); #wp

    if (file_exists(THESIS_CUSTOM)) {
    define(‘THESIS_CUSTOM_FOLDER’, get_bloginfo(‘stylesheet_directory’) . ‘/custom/’.$wpdb->blogid); #wp
    define(‘THESIS_LAYOUT_CSS’, THESIS_CUSTOM . ‘/layout.css’);
    define(‘THESIS_ROTATOR’, THESIS_CUSTOM . ‘/rotator’);
    define(‘THESIS_ROTATOR_FOLDER’, THESIS_CUSTOM_FOLDER . ‘/rotator’);
    }
    elseif (file_exists(TEMPLATEPATH . ‘/custom-sample’)) {
    define(‘THESIS_SAMPLE_FOLDER’, get_bloginfo(‘stylesheet_directory’) . ‘/custom-sample’); #wp
    define(‘THESIS_LAYOUT_CSS’, TEMPLATEPATH . ‘/custom-sample/layout.css’);
    define(‘THESIS_ROTATOR’, TEMPLATEPATH . ‘/custom-sample/rotator’);
    define(‘THESIS_ROTATOR_FOLDER’, THESIS_SAMPLE_FOLDER . ‘/rotator’);
    }

    // Load classes
    require_once(THESIS_CLASSES . ‘/comments.php’);
    require_once(THESIS_CLASSES . ‘/css.php’);
    require_once(THESIS_CLASSES . ‘/data.php’);
    require_once(THESIS_CLASSES . ‘/favicon.php’);
    require_once(THESIS_CLASSES . ‘/head.php’);
    require_once(THESIS_CLASSES . ‘/javascript.php’);
    require_once(THESIS_CLASSES . ‘/loop.php’);
    require_once(THESIS_CLASSES . ‘/options_design.php’);
    require_once(THESIS_CLASSES . ‘/options_page.php’);
    require_once(THESIS_CLASSES . ‘/options_site.php’);
    require_once(THESIS_CLASSES . ‘/options_terms.php’);

    // Admin stuff
    if (is_admin()) { #wp
    require_once(THESIS_ADMIN . ‘/file_editor.php’);
    require_once(THESIS_ADMIN . ‘/fonts.php’);
    require_once(THESIS_ADMIN . ‘/header_image.php’);
    require_once(THESIS_ADMIN . ‘/options_manager.php’);
    require_once(THESIS_ADMIN . ‘/options_post.php’);
    require_once(THESIS_ADMIN . ‘/admin.php’);
    }

    // Load template-based function files
    require_once(THESIS_FUNCTIONS . ‘/comments.php’);
    require_once(THESIS_FUNCTIONS . ‘/compatibility.php’);
    require_once(THESIS_FUNCTIONS . ‘/content.php’);
    require_once(THESIS_FUNCTIONS . ‘/document.php’);
    require_once(THESIS_FUNCTIONS . ‘/feature_box.php’);
    require_once(THESIS_FUNCTIONS . ‘/helpers.php’);
    require_once(THESIS_FUNCTIONS . ‘/multimedia_box.php’);
    require_once(THESIS_FUNCTIONS . ‘/nav_menu.php’);
    require_once(THESIS_FUNCTIONS . ‘/post_images.php’);
    require_once(THESIS_FUNCTIONS . ‘/teasers.php’);
    require_once(THESIS_FUNCTIONS . ‘/version.php’);
    require_once(THESIS_FUNCTIONS . ‘/widgets.php’);

    // Load HTML frameworks
    require_once(THESIS_HTML . ‘/content_box.php’);
    require_once(THESIS_HTML . ‘/footer.php’);
    require_once(THESIS_HTML . ‘/frameworks.php’);
    require_once(THESIS_HTML . ‘/header.php’);
    require_once(THESIS_HTML . ‘/hooks.php’);
    require_once(THESIS_HTML . ‘/sidebars.php’);
    require_once(THESIS_HTML . ‘/templates.php’);

    // Launch Thesis within WordPress
    require_once(THESIS_FUNCTIONS . ‘/launch.php’);

    // Include the user’s custom_functions file, but only if it exists
    if (file_exists(THESIS_CUSTOM . ‘/custom_functions.php’))
    include_once(THESIS_CUSTOM . ‘/custom_functions.php’);

  18. ape says

    Sorry, I gave a incomplete functions.php code in my previous comment.

    It is now:
    blogid);

    // Define folder constants
    define(‘THESIS_CSS_FOLDER’, get_bloginfo(‘template_url’) . ‘/lib/css’); #wp
    define(‘THESIS_SCRIPTS_FOLDER’, get_bloginfo(‘template_url’) . ‘/lib/scripts’); #wp
    define(‘THESIS_IMAGES_FOLDER’, get_bloginfo(‘template_url’) . ‘/lib/images’); #wp

    if (file_exists(THESIS_CUSTOM)) {
    define(‘THESIS_CUSTOM_FOLDER’, get_bloginfo(‘stylesheet_directory’) . ‘/custom/’.$wpdb->blogid); #wp
    define(‘THESIS_LAYOUT_CSS’, THESIS_CUSTOM . ‘/layout.css’);
    define(‘THESIS_ROTATOR’, THESIS_CUSTOM . ‘/rotator’);
    define(‘THESIS_ROTATOR_FOLDER’, THESIS_CUSTOM_FOLDER . ‘/rotator’);
    }
    elseif (file_exists(TEMPLATEPATH . ‘/custom-sample’)) {
    define(‘THESIS_SAMPLE_FOLDER’, get_bloginfo(‘stylesheet_directory’) . ‘/custom-sample’); #wp
    define(‘THESIS_LAYOUT_CSS’, TEMPLATEPATH . ‘/custom-sample/layout.css’);
    define(‘THESIS_ROTATOR’, TEMPLATEPATH . ‘/custom-sample/rotator’);
    define(‘THESIS_ROTATOR_FOLDER’, THESIS_SAMPLE_FOLDER . ‘/rotator’);
    }

    // Load classes
    require_once(THESIS_CLASSES . ‘/comments.php’);
    require_once(THESIS_CLASSES . ‘/css.php’);
    require_once(THESIS_CLASSES . ‘/data.php’);
    require_once(THESIS_CLASSES . ‘/favicon.php’);
    require_once(THESIS_CLASSES . ‘/head.php’);
    require_once(THESIS_CLASSES . ‘/javascript.php’);
    require_once(THESIS_CLASSES . ‘/loop.php’);
    require_once(THESIS_CLASSES . ‘/options_design.php’);
    require_once(THESIS_CLASSES . ‘/options_page.php’);
    require_once(THESIS_CLASSES . ‘/options_site.php’);
    require_once(THESIS_CLASSES . ‘/options_terms.php’);

    // Admin stuff
    if (is_admin()) { #wp
    require_once(THESIS_ADMIN . ‘/file_editor.php’);
    require_once(THESIS_ADMIN . ‘/fonts.php’);
    require_once(THESIS_ADMIN . ‘/header_image.php’);
    require_once(THESIS_ADMIN . ‘/options_manager.php’);
    require_once(THESIS_ADMIN . ‘/options_post.php’);
    require_once(THESIS_ADMIN . ‘/admin.php’);
    }

    // Load template-based function files
    require_once(THESIS_FUNCTIONS . ‘/comments.php’);
    require_once(THESIS_FUNCTIONS . ‘/compatibility.php’);
    require_once(THESIS_FUNCTIONS . ‘/content.php’);
    require_once(THESIS_FUNCTIONS . ‘/document.php’);
    require_once(THESIS_FUNCTIONS . ‘/feature_box.php’);
    require_once(THESIS_FUNCTIONS . ‘/helpers.php’);
    require_once(THESIS_FUNCTIONS . ‘/multimedia_box.php’);
    require_once(THESIS_FUNCTIONS . ‘/nav_menu.php’);
    require_once(THESIS_FUNCTIONS . ‘/post_images.php’);
    require_once(THESIS_FUNCTIONS . ‘/teasers.php’);
    require_once(THESIS_FUNCTIONS . ‘/version.php’);
    require_once(THESIS_FUNCTIONS . ‘/widgets.php’);

    // Load HTML frameworks
    require_once(THESIS_HTML . ‘/content_box.php’);
    require_once(THESIS_HTML . ‘/footer.php’);
    require_once(THESIS_HTML . ‘/frameworks.php’);
    require_once(THESIS_HTML . ‘/header.php’);
    require_once(THESIS_HTML . ‘/hooks.php’);
    require_once(THESIS_HTML . ‘/sidebars.php’);
    require_once(THESIS_HTML . ‘/templates.php’);

    // Launch Thesis within WordPress
    require_once(THESIS_FUNCTIONS . ‘/launch.php’);

    // Include the user’s custom_functions file, but only if it exists
    if (file_exists(THESIS_CUSTOM . ‘/custom_functions.php’))
    include_once(THESIS_CUSTOM . ‘/custom_functions.php’);

  19. ape says

    Sorry, there is a limit on the lines?

    I have a line above // Define folder constants. This is:

    global $wpdb

  20. ape says

    Forget my last two remarks.

    The problew was I added the global $wpdb without a ; on the end.

    So if I use:

    global $wpdb;

    Everything goes swell.

    Thanks for the great information.

  21. Mars says

    I’m using WP3.0 multi site, Thesis 1.8 and the blog id method (as above) But although I feel I’ve done all the steps correctly all my blogs appear the same i.e. I’m not getting a different header image, layout, page bg color, etc for each

    I’ve changed the thesis_18/custom/functions.php file with the following 2 updates:

    1) global $wpdb; (at the top of script)

    2) if (file_exists(THESIS_CUSTOM)) {

    define(‘THESIS_CUSTOM_FOLDER’, get_bloginfo(‘stylesheet_directory’) . ‘/custom/’ . $wpbd); #wp

    The directory structure looks like this:

    thesis_18/custom/3/layout.css, etc
    thesis_18/custom/5/layout.css, etc

    Could someone help out here, would be really grateful ?

  22. Mars says

    Hi Shivanand

    I corrected $wpbd in the below but still have a problem.
    define(‘THESIS_CUSTOM_FOLDER’, get_bloginfo(‘stylesheet_directory’) . ‘/custom/’ . $wpdb); #wp

  23. says

    Brilliant, I’ve been looking for this for ages!

    Do you have any idea how to fix the registration form under Thesis? It seems that as soon as you enable multi-site and try to use Thesis the registration page is broken which makes it very unsightly if you want people to register for their own blog!

    Phil

  24. says

    Hello

    It’s worked with me. i have use title contain “|”. when I use blog name, I can’t create folder contain “|”.So I try with blog id folder instead blog name and it’s worked too.

    Very happy !

    Thanks all !

To post a comment…

Connect with:

Comment on Using Thesis Theme With A WordPress Multisite Installation