Created
December 15, 2017 14:55
-
-
Save glueckpress/9fbc1a03a0525e48a60bde22b892dd44 to your computer and use it in GitHub Desktop.
[WordPress][WP Rocket] As of 2.11, WP Rocket generates critical CSS automatically. Here’s how to adjust parameters for maximum viewport width and height.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Customise parameters for critical CSS generator. | |
*/ | |
add_filter( 'rocket_cpcss_job_request', function ( $item ) { | |
return array( | |
'url' => $item['url'], | |
'mobile' => 0, // 1 = Emulate a mobile device | |
'viewport_width' => 1300 // px maximum width of the viewport | |
'viewport_height' => 900 // px maximum height of the viewport | |
); | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment