Advertisement
swte

Disable Lazyload images on specific pages

May 26th, 2020
1,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. /**
  2.  * Plugin Name: Swift Performance Tweaks
  3.  */
  4.  
  5. add_filter('swift_performance_option_lazy-load-images function($value){
  6.     $pages = array(
  7.         '/page-1',
  8.         '/another-page'
  9.     );
  10.    if (isset($_SERVER['REQUEST_URI']) && in_array(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), $pages)){
  11.        return 0;
  12.    }
  13.    return $value;
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement