解决wordpress多站点下图片上传后无法正常显示的问题

或许有人和我一样折腾过wordpress多站点,估计有人也碰到过,就是在多站点下,子站点上传的图片无法正常显示出来,这个问题是折腾我最久的wordpress问题之一,在网上找了很多方法,但是没有成功,今天回过头来再搞的时候,发现其实就是伪静态转接时的问题,我也是参考了luchenue的方法,解决的办法是打开wordpress的ms-files.php源文件,路径:wp-includes/ms-files.php

然后小修改~

在最后

// If we made it this far, just serve the file
readfile( $file );

改为

// If we made it this far, just serve the file
// fix utf-8 dom
ob_clean();
flush();
readfile( $file );
flush();
如果是修改多站点的图片上传路径,可以参考漠天的:wordpress多站点下修改文件上传目录

Leave a Reply

You must be logged in to post a comment.

RSS feed for comments on this post. TrackBack URL