Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // preload css in wordpress
- // add this code in child theme function.php
- add_filter( 'style_loader_tag', 'preload_css', 10, 2 );
- function preload_css( $html, $handle ){
- $targetHanlde = array('zuhaus_mikado_child_style');
- if( in_array( $handle, $targetHanlde ) ){
- $html = str_replace("rel='stylesheet'", "rel='preload'", $html);
- }
- return $html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement