Home Forums WoodMart support forum Preload key requests – link rel=preload

Preload key requests – link rel=preload

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #233208

    harton
    Participant

    Hello,
    I would like to ask you how to resolve this issue from Google PageSpeed:

    Consider using <link rel=preload> to prioritize fetching resources that are currently requested later in page load:

    …fonts/woodmart-font.woff

    Thanks.

    Attachments:
    You must be logged in to view attached files.
    #233218

    Artem Temos
    Keymaster

    Hello,

    Thank you so much for contacting our support center.

    This file is loaded via CSS and not using <link tag. Sorry, but it is not possible to add such an attribute there.

    Kind Regards
    XTemos Studio

    #233456

    GHGbR
    Participant

    @harton

    The following snippet has helped me:

    // Preload fonts for mobile theme
    
    function dns_prefetch_mobile() {
    	
    	echo "<link href='https://yourURL.test/wp-content/themes/woodmart/fonts/woodmart-font.woff?v=5.2.0' rel='preload' as='font' type='font/woff' crossorigin='anonymous'>";
    }
    add_action( 'wp_head', 'dns_prefetch_mobile', 0 );
Viewing 3 posts - 1 through 3 (of 3 total)