Preload key requests - FONTS

Hi I am instructed by my cache plugin to insert the following codes because they are responsible for late-discovery of critical resources.

But I am unable to figure out where to insert these codes so preload key requests get vanished. If i have to insert it in my child theme then kindly tell me full code because I am a bit novice.

Hi Sansar,

Please ask the cache plugin developer where should it be added. Although most likely it is on the header but it will be best to confirm.

First you might need to install a child theme. Then look at this documentation to see sample code on how to add it on the header area.

Yes they confirmed that we can insert that code on the header.

I am novice, can you tell me can we insert these codes through functions.php?

If yes, then how

Hello Sansar,

Please install and activate the child theme and login through FTP then edit the functions.php of the child theme then add this code:


add_action('wp_head', 'add_header_code');
function add_header_code(){
?>

    <!-- Add the codes here -->

    <?php
};

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.