How to disable google fonts?

How can I disable google fonts? I want to integrate that in the footer because I get the error “above the fold” in google page speed.

Hello there,

Edit the functions.php file. Remove the following lines:


if ( get_theme_mod('body_font_name') !='' ) {
    wp_enqueue_style( 'sydney-body-fonts', '//fonts.googleapis.com/css?family=' . esc_attr(get_theme_mod('body_font_name')) );
} else {
    wp_enqueue_style( 'sydney-body-fonts', '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600');
}

if ( get_theme_mod('headings_font_name') !='' ) {
    wp_enqueue_style( 'sydney-headings-fonts', '//fonts.googleapis.com/css?family=' . esc_attr(get_theme_mod('headings_font_name')) );
} else {
    wp_enqueue_style( 'sydney-headings-fonts', '//fonts.googleapis.com/css?family=Raleway:400,500,600');
}

To change the body font, use the following CSS code:


body, #mainnav ul ul a { 
  font-family: "Times New Roman", Georgia, Serif;
}

To change the headings fonts, use the following CSS code:


h1, h2, h3, h4, h5, h6, #mainnav ul li a, .portfolio-info, .roll-testimonials .name, .roll-team .team-content .name, .roll-team .team-item .team-pop .name, .roll-tabs .menu-tab li a, .roll-testimonials .name, .roll-project .project-filter li a, .roll-button, .roll-counter .name-count, .roll-counter .numb-count button, input[type="button"], input[type="reset"], input[type="submit"]{ 
  font-family: "Times New Roman", Georgia, Serif;
}  

As you are editing the core theme’s file, you should take it at your own risk. Future update of the theme won’t read the changes you have made.

Regards,
Kharis

ok thank you very much. Now I have 90 page speed. Great. I have to optimize only some pictures and then I’m getting close to 100 I think. How much must be the perfect image size of the employees?

Ok got it! It was 82x64… :slight_smile:

Hi,
I disabled Google Fonts, then uploaded the font files into the child theme’s font folder and used the above mentioned code. It perfectly works on desktop but does not on mobile.
What do I have to change?

Best
Phil

Hello Phil,

Try clearing your mobile web browser’s cache as it may still loads older version of your site.

https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens

Regards,
Kharis

Thanks. I tried on different mobile devices and it works on none of them. Do you have another idea? Even though each part of the css asks for a sans serif, on mobile a serif font is displayed.

Any idea? I am lost.

got it. Had to add further font types to the css