php - Wordpress - Disabling automated resizing system -
i'm having problem wordpress image resizing system. started getting after upgraded 4.2.2.
i use 1 page responsive theme , there's photo gallery on portfolio part. when click 1 of thumbnail ajax load show bigger photos, not lightbox.
this same theme use: http://visia.themes.pixelentity.com
(click "folio" go "our work" section, click 1 of thumbnails open bigger images. bigger image part called "project" in admin area, thumbnails coming "galleries", "our work" section made "page" in admin.) on site, after upload photos on gallery, generates specific size of window, presumably code in php somewhere in theme folder.
and if check source code,
<img alt="" width="680" height="519" src="http://yourdomain.com/wp-content/uploads/2015/05/yourphoto-680x519.jpg">
it adds "680x519" @ end of image url taken media upload folder.
but if see original theme site, photos shows perfectly, not site. (before upgrade, shows perfectly.)
i have tried suggestions multiple forums removes size attributes using these add_filer codes below attached function.php:
add_filter( 'post_thumbnail_html', 'remove_width_attribute', 10 ); add_filter( 'image_send_to_editor', 'remove_width_attribute', 10 ); function remove_width_attribute( $html ) { $html = preg_replace( '/(width|height)="\d*"\s/', "", $html ); return $html; }
but no luck.
as i'm designer, not developer, don't not how works. hoping knows how remove size dimension code automatically added uploaded images in gallery.
ok found bastard caused problem.
as happened specific photos, in case, on gallery photos. looked gallery php file in theme folder , there file called mytheme-gallery.php.
then found line:
$destfilename = "{$upload_dir}{$dst_rel_path}-{$suffix}.{$ext}";
and removed -{$suffix}
voilĂ ! hardcoded url disappeared , images showed up.
Comments
Post a Comment