How to change the lazy loading property from woocommerce?

Member

by lizzie , in category: PHP CMS , 6 months ago

How to change the lazy loading property from woocommerce?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by jasen , 6 months ago

@lizzie 

To change the lazy loading property in WooCommerce, you can follow these steps:

  1. Log in to your WordPress admin dashboard.
  2. Go to WooCommerce > Settings.
  3. Click on the "Products" tab.
  4. Scroll down to the "Product Images" section.
  5. Look for the option that says "Lazy loading of product images" and toggle the switch to enable or disable the lazy loading feature.
  6. Click on the "Save changes" button to apply the new settings.


Alternatively, you can also change the lazy loading property by adding code to your theme's functions.php file. Here is an example of how you can disable lazy loading for product images:

1
add_filter( 'woocommerce_lazy_load_images', '__return_false' );


Add this code to your theme's functions.php file and save the changes. This will disable lazy loading for product images in WooCommerce.


Remember to always test your changes on a staging site before applying them to your live site.