AI Verified

Name

Stop Lazy Load for 1 Image

About

Hover over your image in the Media Library to get the ID value and then replace the 10576 in the code.

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

WebSquadron

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

27/05/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Stop Lazy Load for 1 Image

 
                    
1function wphelp_no_lazy_load_id( $value, $image, $context ) {
2if ( 'the_content' === $context ) {
3$image_url = wp_get_attachment_image_url( 10576, 'large' );
4if ( false !== strpos( $image, ' src="' . $image_url . '"' )) {
5return false;
6}
7}
8return $value;
9}
10add_filter( 'wp_img_tag_add_loading_attr', 'wphelp_no_lazy_load_id', 10576, 10576 );

0

Related Snippets

Please see some snippets below related to this snippet..

Performance

AI Verified

5

Media Library Infinite Scrolling

Added: 1 year ago

Last Updated: 4 months ago

wordpress media library infinite scrolling

Performance

AI Verified

2

Ensure Fonts Loaded

Added: 1 year ago

Last Updated: 1 year ago

Ensure Fonts Loaded

Performance

AI Verified

1

Remove Google Fonts (Non Elementor)

Added: 11 months ago

Last Updated: 1 month ago

Removed Google Fonts for Non Elementor Websites

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Performance

AI Verified

29

Remove Unused Javascript

Added: 1 year ago

Last Updated: 1 month ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

9

Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 6 months ago

Deactivate some WooCommerce Checkout Fields from showing

Performance

Pro Verified

5

Disable e-icons from Elementor

Added: 1 year ago

Last Updated: 1 year ago

Disable e-icons - and remove the notification from occurring during your Page Speed Insight Check.