Create image formats with different qualities when uploading

1) A workaround by extending the WP_Image_Editor_GD class The problem is how to access the image sizes before we change the quality of intermediate jpeg images. Note that the image_resize() function is deprecated. We can use the jpeg_quality filter from the public get_quality method of the abstract WP_Image_Editor class: $quality = apply_filters( ‘jpeg_quality’, $quality, ‘image_resize’ … Read more

How to insert pictures without hard coded dimensions?

I don’t know if this is the best way to do this, but it works for me. In the functions.php of the theme you are using, put this: function remove_img_src($html) { $html = preg_replace(‘@(width|height)=”([0-9])+” ?@i’, ”, $html); return $html; } add_filter(‘image_send_to_editor’, ‘remove_img_src’, 10, 8); It uses regular expresions to change the output that is inserted … Read more

WP 4.4. responsive images browser choosing the “wrong” one

Concerning documentation there is this blog post on the Make Blog: Responsive Images in WordPress 4.4 To increase the 1600px limit mentioned in the comments try this: add_filter(‘max_srcset_image_width’, function($max_srcset_image_width, $size_array){ return 2000; }, 10, 2); Finally as already mentioned you should fix your calls to add_image_size add_image_size(‘news-large’, 1024, false); needs to be add_image_size(‘news-large’, 1024, 0, … Read more

Proper usage of wp_is_mobile()?

In very layman term wp_is_mobile() is not for styling your theme. How it works: It matches some of device’s native name in User Agent String. So if someone manipulate the string and send false information you can not detect what device it is. And it does not return any device name it just return true … Read more

How do I disable responsive images in WP 4.4?

Here are few things you could try to remove the responsive image support in 4.4: /** * Disable responsive image support (test!) */ // Clean the up the image from wp_get_attachment_image() add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if( isset( $attr[‘sizes’] ) ) unset( $attr[‘sizes’] ); if( isset( $attr[‘srcset’] ) ) unset( $attr[‘srcset’] ); return $attr; … Read more

Full width image in separated row on wordpress (Ref attacted)

Since you’ve mentioned that you’re using Siteorigin’s page builder, I’ve decided to do a short video of how I would arrange the elements on the builder to achieve the results you’re after. here’s my screencast: http://somup.com/cFit60VLyy Now there are few flaws with siteorigin’s pagebuilder – there is no inbuilt column equalizer for rows unlike other … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)