-
AuthorPosts
-
August 2, 2016 at 1:41 pm #667624
Hi there,
I am using Adobe Typekit to implement a site wide font. This has been implemented using the “Typekit Fonts for WordPress” plugin. The problem that I have is that the header of the site features a prominent Call to Action (colour section with YouTube video background”.
The site loads relatively quickly, although the default fonts are loading first, followed by the Typekit fonts. Is there a way stop the default fonts from loading, or prioritise the Typekit font?
I have temporarily disabled the YouTube video in the header, however this does not reduce the load time.
The site is using the WP Super Cache plugin, however this does not appear to me a significant difference.
I assume that there is a method of prioritising the Typekit embed code, and thereby loading the font before other resources are loaded?
Thanks for your help
- This topic was modified 8 years, 3 months ago by csmwebdesign.
August 2, 2016 at 8:46 pm #667826I’ve spent quite a long time attempting to troubleshoot this, rather unsuccessfully.
I’ve removed the YouTube video’s, section background, and also on the call to action, I’ve removed the Typekit font.
I’ve created a video to show what is happening, link is the in private content. Thanks.
August 2, 2016 at 9:06 pm #667833Further followup, removing the Typekit font from my child styles.css resolves the issue, therefore the slight FOUC / stutter on font change presumably can be prevented by only displaying my Typekit font? The trouble appears to be at the moment that Enfold is attempting to load a default font, and then switch to my Typekit font. In actual fact, I only want the Typekit font to be used throughout the entire site.
I’ve added the font to the theme and set it as the default font for body and headings, as per this post, unfortunately the FOUC / stutter is quite obvious: https://kriesi.at/support/topic/new-custom-font/
My code is:
add_action( ‘init’, ‘enfold_customization_swtich_fonts’ );
function enfold_customization_swtich_fonts() {
global $avia;
$avia->style->print_extra_output = false;
}add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
function avia_add_heading_font($fonts)
{
$fonts[‘kepler-std-display’] = ‘kepler-std-display’;
return $fonts;
}
add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
function avia_add_content_font($fonts)
{
$fonts[‘kepler-std-display’] = ‘kepler-std-display’;
return $fonts;
}
Thanks in advance- This reply was modified 8 years, 3 months ago by csmwebdesign.
August 8, 2016 at 2:32 am #669555Hi,
Please post an access to the site too, i’ve added it to hosts but it’s displaying a maintenance page.
Best regards,
JosueAugust 8, 2016 at 11:03 am #669744Hi Josue, the site isn’t live yet so there is no other way of accessing. If you are viewing a maintenance page, the entry in the hosts file is not being referenced correctly. Hosts file entry added to private content.
ThanksAugust 8, 2016 at 5:09 pm #669935I have it exactly like that in hosts, anyhow have you tried using an async code instead of the wp plugin?
New embed code for asynchronous font loadingBest regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.