timthumb.php is awesome. Unfortunately, it doesn’t work very well with WordPress Multisite. Despite a number of people who have proposed solutions, none of them seem to provide a simple, drop in replacement for timthumb.php which just works. Well, now I have.
The Problem
timthumb.php doesn’t know how to deal with the blogs.dir directory in which WordPress stores images in Multisite. Ideally, you should update your theme to point to the correct directory, or even use WordPress’ built in thumbnail handling. However, if you don’t want to mess around with all of this then simply download timthumb.php and replace your timthumb.php. Problem solved.
How it works
This slightly modifies the function which timthumb uses to find the path to the specified image file. If it detects a blogs.dir directory, it looks through each individual “site” directory until it finds the one which contains the image in question.
There is one potential gotcha in this implementation. If you have identically named files, uploaded in the same month in two different “sites”, this script will use the first one it finds, which may, or may not be the one you intended.
Who's Lookin'
Listen this is brilliant – you saved me so many hours- so finally my multi-site is working with timthumb without any modification….
Listen do u think you could upgrade the script to the latest version of Timthumb v1.26? I Tried but i am missing something…
this is GREAT bro!!!
Hi mate,
I replaced the file but still no change, not even an error.
Could you help?
thanks .
and do you upgrade the code to the latest version ? thanks…
THANK YOU, THANK YOU, THANK YOU! You are my hero!
Fantastic. Great solution. I appreciate that you have taken your time to save all of us and make this work. I have twice come to screeching halts with themes because of this path issue.
this is awesome! saved me many hours… thanks a lot!
Saved my bacon. Thanks a bunch!
Dont work here :s is cache? wp-content/blogs.dir/cache?
wp-content/blogs.dir/1/cache?
Wow! I am working on setting up a new WP multisite network, and the tinythumb issue was driving me bonkers. I tried 3 different workarounds that I read about, with no luck. When I finally stumbled onto your solution – I was skeptical. How could it be so easy. But I replaced the file and voila! – it just worked.
Thank You! Thank You! Thank You!
@Anderson:
Can you provide an example of where it’s not working?