What sense makes medium_large_size_h => 0?

It appears that it’s eventually used as a parameter to wp_constrain_dimensions where ‘0’ means ‘no limit’. It’s only used directly in media.php:85 } elseif ( ‘medium_large’ === $size ) { $max_width = intval( get_option( ‘medium_large_size_w’ ) ); $max_height = intval( get_option( ‘medium_large_size_h’ ) ); if ( intval( $content_width ) > 0 ) { $max_width = … Read more

How to force WordPress to upscale images?

You can always use the full size, but if the issue is that your images don’t cover enough area, you can fix that with CSS and the background-size and object-fit parameters. This will let you use img tags that are larger than the source image, or background images smaller than their container, and allow you … Read more

Partial img lazy load with WP 5.5

Whether or not the loading=”lazy” attribute will be added to images from these plugins depends entirely on how those plugins are outputting their images. As outlined in this blog post, WordPress 5.5 only adds the loading=”lazy” attribute automatically to the following images: images within post content (the_content) images within post excerpts (the_excerpt) images within text … Read more

Automatically Insert alt attribute above image has h2

I find the solution using this How to change the markup WordPress inserts for post images My final code is: add_filter( ‘image_send_to_editor’, ‘add_custom_data_attribute_send_to_editor’, 10, 8 ); function add_custom_data_attribute_send_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ){ if( $id > 0 ){ $post = get_post( $id ); $html = str_replace( “<img src”, “<h2>$alt</h2><img src”, $html … Read more

URL through custom field returning null

Refer ACF link : Link And use <?php echo get_field(‘aboutus_img’); ?> Choose option image url This example demonstrates how to display the selected image when using the Image URL return type. This return type allows us to efficiently display a basic image but prevents us from loading any extra data about the image. <?php if( … Read more