Timthumb For MU

Jan 09

Timthumb For MU

Working for a client recently I had to convert a bunch of WordPress themes to MU themes.  It is usually a VERY simple task, taking around 10 minutes for each theme, until I looked a these themes.  To my surprise they were themes from the very same site as the theme I use ElegantThemes.

I am familiar with how to customize these themes for regularWordPress, but MU isn’t regular WordPress, now is it?

There were only a couple of places where code had to be changed in the actual theme itself (uploadable logo, etc), but then I ran into timthumb.php.

After messing around with Google for about an hour, I decided to go at it on my own, and the file attached at the bottom is the end result.

It supports MU for sub-domains and sub-folders, and is as simple as replacing your timthumb.php file in your theme (well plus another step).

  1. Modify your timthumb_mu_*php files to use the correct database credentials for your blog.
  2. Upload timthumb_mu_*.php files to your themes (wordpress-mu/wp-content/themes) directory.
  3. Modify timthumb to point to the correct version of the timthumb_mu_*.php
    • folders is for when you use folders
    • subdirectories is for when you use sub directories
  4. Upload the modified timthumb.php to your theme (wordpress-mu/wp-content/themes/theme_name) directory.
  5. Test the site obviously ;) .

That should be all you need to do to get it to work.

Questions or comments, leave them below.

timthumb_mu.php – Download Now!

Leave a Reply