Example: https://mydomain.com/wp-content/uploads/28H109-scaled.webp
Desired: https://mydomain.com/wp-content/uploads/28H109.webp
URL: https://doyuk.com/bags/eco-cotton-bag/
https://monosnap.com/file/K6Hn0Mi9TuM4zGCq65QlZH2LqSm3o6
https://monosnap.com/file/DSPzE7Ub4GFqsDkXayvkU0Lxhi9nkH
<ImageURL>https://doyuk.com/wp-content/uploads/2019/06/TOSKANA2.jpg</ImageURL>
<ImageURL>https://doyuk.com/wp-content/uploads/2019/06/TOSKANA1.jpg</ImageURL>
<ImageURL>https://doyuk.com/wp-content/uploads/2019/06/TOSKANA3.jpg</ImageURL>
<ImageURL>https://doyuk.com/wp-content/uploads/2019/06/TOSKANA4.jpg</ImageURL>
<ImageURL>https://doyuk.com/wp-content/uploads/2019/11/eco-friendly.svg</ImageURL>
]]>I am using a window system and setup a site locally, the main issue is the URL replace, as the window uses backslash for path so the function is unable to replace it here in wp_media.class.php
for the $this->options['local_path']
if uses backslash it gives double backslash. So it wont replace the path for wp-content.
To fix this I uses a custom line
$localPath = str_replace('\\\\', '\\', $this->options['local_path']);
public function url_handler($url)
{
$localPath = str_replace('\\\\', '\\', $this->options['local_path']);
$uploadDir = str_replace($localPath, "", $this->uploadDir["path"]);
$uploadDir = preg_replace("/\/\d{4}\/\d{2}/", "", $uploadDir);
preg_match("/(\/\d{4}\/\d{2}\/.+$)/", $url, $matches);
$s3_path = preg_replace(["/[\/]+/", "/^\//"], ["/", ""], $uploadDir . "/" . $matches[1]);
$url = $this->options["s3_url"] . $s3_path;
return $url;
}
]]>I have a WordPress 4.2.2 running with 45+ sites. We just upgraded from 3.5 to 4.2.2 which was a great deal. Problem is that the media-uploader is now broken.
I’m working with sub-directories
The media upload now only works on the main site after I changed the upload path via Network > Sites > Settings
to wp-content/blogs.dir/1/files
.
When I go to a sub-site to upload a file it gives me this url:
https://santexo.acsrackserver2.nl/bouwbedrijfpostma/files/2015/05/media_xll_1105222.jpg which wordpress processes to:
https://santexo.acsrackserver2.nl/wp-includes/ms-files.php?file=2015/05/media_xll_1105222.jpg which doesn’t work.
When I put the blogname into the url like this:https://santexo.acsrackserver2.nl/bouwbedrijfpostma/wp-includes/ms-files.php?file=2015/05/media_xll_1105222.jpg it does work.
Here is my .htaccess (i copied it from the old site)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [R=301,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-content/uploads/$2 [R=301,L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule ^snelstart/(.*\.xml) snelstart/orders.php [NC,L] # Handle product requests
RewriteRule . index.php [L]
</IfModule>
I have been searching all over the net, but I just can’t find any topic that has a solution..
Any one have an idea what’s wrong?
]]>I have been using this plugin for some time now. I’ve just started using the extended template feature, but am facing a major roadblock.
The thumbnail sizes are being limited to 91×68, which is very tiny. The page where I am displaying the gallery needs to be somewhere in the ballpark of 355×240.
After searching around a bit for a filter the only thing I was able to come across was another thread explaining how to hack up the core files to achieve this.
As we all know (or should know) hacking up core files within a plugin or theme is a pretty bad idea as it will cause some serious issues when updating to the next release.
Searching through some of the folders, I can see that the thumbnail is dynamically generated along with the original image size. When I test the contents of the $gallery variable using print_r($gallery), I can see that the thumbnail URL (previewurl) is being passed within the array, but the original image size IS NOT.
The only way I was able get things working using the original image size was to add in a simple str_replace function inside of the image SRC, to replace the 91×68 image size with my full image size.
Code:
<img class="gallery_image" alt="<?php echo esc_attr($gallery->title); ?>" src="<?php echo nextgen_esc_url( $gallery->previewurl ); ?>"/>
As you can see the $gallery->previewurl is passed into the src attribute of the image. But the original url is unavailable inside of this array. Can we add the original URL as well so we can use that if we so choose?
In the meantime, my fix looks like this:
<img class="gallery_image" alt="<?php echo esc_attr($gallery->title); ?>" src="<?php echo nextgen_esc_url(str_replace( '91x68-00f0w010c011r110f110r010t010' , '355x240x100-00f0w010c010r110f110r010t010' , $gallery->previewurl ) ); ?>"/>
Thanks,
Evan
https://www.ads-software.com/plugins/nextgen-gallery/
]]>https://www.ads-software.com/plugins/slideshow-jquery-image-gallery/
]]>?How can I repair this problem? I think is beause I dont use Featured Image.
]]>How can repair this, I have this problem repeated times when I enter in my dasboard.
]]>