Preconnecting google fonts

How can I do it ? where i must add such code ?

Hi There,

Thanks for writing in!
There is little confusion about your requirement. Can you please confirm are trying to include google font? in your site.
Or some thing else you want to achieve?

Thanks

I wish to avoid the jump effect using the preconnect option i have read it here


i attach a screeenshot of my jump effect

Hey @Borislav.VD,

Looks like you need to add it in the head. The function should look like this.

add_action('wp_head', 'preconnect_sites', 1);
function preconnect_sites() {
?>
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
<?php
};

The priority is 1 to output the code first in the head.

Just note that dealing with optimization is outside the scope of our support. In case what I suggested does not help with regards to performance, you will need to hire a third party developer to work closely with you.

Thanks.

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