SHOW:
|
|
- or go back to the newest paste.
| 1 | /** | |
| 2 | * Plugin Name: Swift Performance Tweaks | |
| 3 | * Load Full CSS on Scroll on specific pages only | |
| 4 | */ | |
| 5 | - | add_filter('swift_performance_option_lazy-load-images function($value){
|
| 5 | + | |
| 6 | add_filter('swift_performance_option_load-full-css-on-scroll function($value){
| |
| 7 | $pages = array( | |
| 8 | - | '/another-page' |
| 8 | + | '', // use empty for homepage |
| 9 | '/page-1', | |
| 10 | '/another-page', | |
| 11 | - | return 0; |
| 11 | + | |
| 12 | if (isset($_SERVER['REQUEST_URI']) && in_array(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), $pages)){
| |
| 13 | return 1; | |
| 14 | } | |
| 15 | return $value; | |
| 16 | }); |