Is there a resolution limit in image resize?

Operations on images are more restricted by the required and available memory than by the file size. The bigger the image is, the more memory it will require in order for it to be manipulated (to be manipulated the relevant libraries usually create a bit map image in the memory so your image will take … Read more

set title attribute in wp_get_attachment_image()

In a relatively fresh install I can’t replicate the issue. When I post your code with my own image ID I get the title=”My Custom Title” attribute. It’s important to note however that the “Title” of an image in the media library is not output as a title attribute in the standard output of wp_get_attachment_image(). … Read more

Missing background image setting in admin of twenty nineteen

It’s not present because it’s not supposed to be present, it was removed. While originally added to the theme, it was deliberately removed due to accessibility concerns, see https://github.com/WordPress/twentynineteen/issues/708 which is the same question but on GitHub Keep in mind that the video you linked to is not the final version of the theme, but … Read more

How to apply lazy loading in background images [closed]

That is nothing that can be installed by a plugin or, at least, would be necessary for you to work on it. However, you can build this yourself. Step 1: Enqueue the IntersectionObserver polyfill you can find here: https://github.com/w3c/IntersectionObserver/blob/master/polyfill/intersection-observer.js to get Support for older Browsers. Step 2: Change the code of your HTML-Elements which use … Read more

Why does WordPress convert my jpg’s to png?

A peek into the WP core file – wp-admin/includes/file.php confirms it is not WP which is doing this. Can you try the following: Check functions.php file in your active theme Try switching to other themes and check if the issue persists Try deactivating all the plugins and then activating them one by one and checking … Read more

Add custom metabox to media library images

Sure! Just follow this guide and make these changes: Hook into the add_meta_boxes_attachment action instead of the add_meta_boxes action In the add_meta_box() call, pass ‘attachment’ as the $screen parameter Hook into the save_post_attachment action instead of the save_post action And of course, make sure to customize the example code to your specific needs.

Omit image captions from get_the_content()

It turned out that the method called strip_tags(preg_replace(” (\[.*?\])”, ”, $output)) before strip_shortcodes($output), which caused aforementioned issue, since the code removed shortcode in square brackets, but retained contained image captions. I could fix it by swapping the two method calls like this: $output = get_the_content(); $output = strip_shortcodes($output); // Strip WordPress shortcodes first! $output = … Read more

Disable lazy loading on specific images

You can manage WordPress lazy loading with the loading parameter. Below code echo’s your image without using the lazy load function. echo wp_get_attachment_image( $image, $size, false, [ ‘class’ => ‘your-class-here’, ‘loading’ => ‘eager’ ] );