Use of DOCUMENT_ROOT leads to incorrect image paths
-
I’m using the custom gallery shortcode but the generated thumbnails fail to display properly. Thumbnail size is set correctly in the shortcode (150×150) but the post still shows the thumbnails as scaled versions of the images instead of nice 150×150 square crops.
I looked at the code and I see that
$_SERVER['DOCUMENT_ROOT']
is used to determine the absolute path to the image. And this presents a problem for my site. The absolute path is determined to be/usr/local/www/apache24/data/Halfje-Bruin/app/uploads/2015/05/16758162527_053c2bb4e0_o-150x150.jpg
but it should be/usr/local/www/sites/Halfje-Bruin/app/uploads/2015/05/16758162527_053c2bb4e0_o-150x150.jpg
Is it not possible to use
wp_content_dir()
to get the proper uploads directory?
- The topic ‘Use of DOCUMENT_ROOT leads to incorrect image paths’ is closed to new replies.