Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Oh damn, how do you disable mobile theme on WP/ what code resizes images?

So my images are getting resized on mobile themes, they are getting smaller while text is equally big.

how do i turn it off?

i tried looking css files but theres nothing about images resizing..


i have website about memes (containing text) and the image that is resized to smaller version on phone isnt readable


im looking for ways to force disabling mobile theme OR responsiveness OR resized images.


Much thx!
Have you tried disabling it in admin panel under appearance ?

I found a method that has worked for others for resizing here

Add this code in functions.php It will remove width height attribute of image when you add image to post content.
Code
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 );
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10, 3 );
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {
    $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
    return $html;
}

Now add following css in your style.css file
Code
img{
     max-width:100%;
     height:auto;
}

If you'd like send me a PM of the website and I can take a look at the source to see if I find anything.

Thanks , Energy
(Jun 10, 2018 10:13 AM)Hᴇxᴀɢᴏɴ Wrote:  Have you tried disabling it in admin panel under appearance ?

I found a method that has worked for others for resizing here

Add this code in functions.php It will remove width height attribute of image when you add image to post content.
Code
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 );
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10, 3 );
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {
   $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
   return $html;
}

Now add following css in your style.css file
Code
img{
    max-width:100%;
    height:auto;
}

If you'd like send me a PM of the website and I can take a look at the source to see if I find anything.

Thanks , Energy

is max-width relative to width attribute (pixels)? because it works when i set max-width to 1500%... but its a little blurred. somehow that 1500% is not modyfing my desktop version so its quite ok
(Jun 10, 2018 10:26 AM)Account of the Gods Wrote:  is max-width relative to width attribute (pixels)? because it works when i set max-width to 1500%... but its a little blurred. somehow that 1500% is not modyfing my desktop version  so its quite ok

Are you using a Template/ Theme ? Kind of an odd fix but maybe there is another script in your CSS causing the desktop not to change.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[MyBB] by hot.dropNov 30, 2019 05:31 AM 6 292 Nov 30, 2019 05:31 AM
Last Post: Morpheus
[MyBB] by Transporter007Dec 28, 2018 05:18 AM 1 120 Dec 28, 2018 05:18 AM
Last Post: Michael
[Wordpress] by SIM-1895121Dec 18, 2016 12:29 PM 1 125 Dec 18, 2016 12:29 PM
Last Post: ajay maanju