Riddick
asked 10 years ago

Hello there
look at the screenshot please (from iphone 4), the image is stretched in length.
http://yadi.sk/d/wXrxfTIFEyGfx
desktop version is OK:
http://yadi.sk/d/HQ1Sx9sxEyHuB
could you please help me to fix it?
Thanks!

2 Answers
DominicStaff
answered 10 years ago

Hi Riddick,
To resolve image issue when you view on the mobile. Please log in to Dashboard > Theme > Customize > Custom Code then add the following code to the ” Header Code”

 <style>
.single-post .entry-content img {
    height: auto !important;
}
</style>
Riddick
replied 10 years ago

thanks for quick reply,
do you mean by “Custom Code” the “DW Header script” ?
DW Header script is empty by default.
or should I add the code to header.php?
anyway I’ve tried both. and it works fine in desktop browser only, img is ok when I scratch the window.
but image issue remains the same on iPhone 4G (safari) and I’ve tried on Galaxy Note (chrome)

Kido D
answered 10 years ago

Hi Riddick,
You can open up the functions.php file in themes/dw-fixel folder, and remove the following code (somewhere at bottom of the file):
 

 if( ! function_exists('dw_remove_thumbnail_dimensions') ) {
function dw_remove_thumbnail_dimensions( $html ) {
$html = preg_replace( '/<img([^>]*)width=\"(\d*)\"([^>]*)height=\"(\d*)"([^>]*)\/>/', '<img $1 $3 $5 style="width:$2px;height:$4px;"/>', $html );
return $html;
}
add_filter( 'the_content', 'dw_remove_thumbnail_dimensions' );
}

 
Hope that helps!

Riddick
replied 10 years ago

yes, that helps!
many thanks!

Powered by DW Question & Answer Pro