Tag Info

New answers tagged

4

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( ...


1

You're over-complicating your thumbnail code; all you need is this: if ( has_post_thumbnail () ) { the_post_thumnail( 'preview-thumb' ); } else { .... The problem with your version is that get_post_thumbnail_id() doesn't accept a size parameter, so that information gets thrown away. Luckily, the_post_thumbnail() does everything you need without having ...



Top 50 recent answers are included