WordPress PNG compression issue

This probably has to do with the ImageMagick library that WP normally uses to resize images. I’m not sure whether it is possible to modify the standard settings WP applies, but it is possible to define your own. Here is a tutorial for that. You would have to replace the filter in that tutorial with … Read more

How to get file URL from media library

If you check the documentation for media_sideload_image() it returns HTML img tag for the image right away. Alternately it can return just the URL. Note that while this is suitable for immediate use, it’s generally challenging to go back from URL to attachment ID. IDs are much more friendly for many things, such as being … Read more

How can I filter image HTML to add schema.org attributes?

works_secondary-image_thumbnail_html is not a WordPress core hook, so your code never executes. As long as images are displayed on your site by calling wp_get_attachment_image in your theme, you can add to the attributes by hooking into wp_get_attachment_image_attributes: add_filter( ‘wp_get_attachment_image_attributes’, ‘wpse_235266_image_attributes’, 10, 3 ); function wpse_235266_image_attributes( $attr, $attachment, $size ) { $attr[‘itemprop’] = ‘image’; return $attr; … Read more

Background-image not showing? [closed]

We lack context, but remember that CSS files are read from top to bottom, the lower definitions having priority over the top ones. The same logic applies within the file. That is why the !important attribute is used for. That being said, in your case you could have A caching plugin that loads a cached … Read more

Resize images in existing posts

So when you regenerated the thumbnails, did you use a plugin like: WordPress Regenerate Thumbnails plugin. Or did you make them in some other fashion? I’ve used this plugin before and it seemed to work for me. Another possible way to do this is with making a style modification in your style.css file. You can … Read more