[Plugin: AutoThumb] SOLUTION: Make AutoThumb work on WP Multisite
-
Here’s a quick & easy solution for making this great plugin work on a WordPress multisite installation.
PLEASE NOTE: The following will require you to make minor code adjustments to 2 files. If you later update the AutoThumb plugin, OR update your permalinks, the changes will be overwritten and you will need to re-add the necessary code to those 2 files.
[Step 1]
Locate
/wp-content/plugins/autothumb/image.php
and add the following code right before the line which readsinclude('phpthumb/phpThumb.php');
:/* Multisite Compatability Hack */ include '../../../wp-config.php'; include '../../../wp-load.php'; if( MULTISITE == true && preg_match('%'.$base.'.*/files/(.+)%i', $_GET['src'], $matches) ){ $_GET['src'] = BLOGUPLOADDIR.$matches[1]; }
[Step 2]
Locate the
.htaccess
file in the root of your WordPress installation, and add the following code directly after the line which readsRewriteRule ^index\.php$ - [L]
:RewriteRule ^YourSiteName/images/(.*)$ /YourSiteName/wp-content/plugins/autothumb/image.php?$1 [QSA,L]
Make sure to replace the word
YourSiteName
with the name of your actual site. For example, if your site is at https://www.someblog.com/MyKittyBlog/ , you would change the above to read as follows:RewriteRule ^MyKittyBlog/images/(.*)$ /MyKittyBlog/wp-content/plugins/autothumb/image.php?$1 [QSA,L]
Note that, with this code, you will need to add a RewriteRule line to your
.htaccess
file for each one of the sites where you want AutoThumb to be able to function. There is probably a better way to do this, but I unfortunately am not a Regular Expressions genius.Questions, comments, or suggestions for a better way to do this? Post them here.
Hopefully the plugin author will update AutoThumb to include multisite comparability in the future. ??
- The topic ‘[Plugin: AutoThumb] SOLUTION: Make AutoThumb work on WP Multisite’ is closed to new replies.