Hummingbird Preload key requests

Help me to solve Preload key requests and Ensure text remains visible during webfont load issues for a custom font in Divi theme.

  • Nithin Ramdas
    • Support Wizard

    Hi Michel ,

    I have updated the code inside your child themes functions.php file from:
    <link rel="preload" href="<?php echo get_template_directory_uri(); ?>/core/admin/fonts/modules.ttf" as="font">

    To:
    <link rel="preload" href="<?php echo get_template_directory_uri(); ?>/core/admin/fonts/modules.ttf" as="font" crossorigin>

    And now the issue with Preload key request has been resolved. Regarding “Ensure text remains visible during Webfont load” this is something which needs to be fixed within the Divi theme side.

    The only workaround, for now, would be to edit the CSS in style.css of the parent Divi theme ie from:

    @font-face{font-family:ETmodules;src:url(core/admin/fonts/modules.eot);src:url(core/admin/fonts/modules.eot?#iefix) format("embedded-opentype"),url(core/admin/fonts/modules.ttf) format("truetype"),url(core/admin/fonts/modules.woff) format("woff"),url(core/admin/fonts/modules.svg#ETmodules) format("svg");font-weight:400;font-style:normal}
    
    

    To:

    @font-face{font-family:ETmodules;src:url(core/admin/fonts/modules.eot);src:url(core/admin/fonts/modules.eot?#iefix) format("embedded-opentype"),url(core/admin/fonts/modules.ttf) format("truetype"),url(core/admin/fonts/modules.woff) format("woff"),url(core/admin/fonts/modules.svg#ETmodules) format("svg");font-weight:400;font-style:normal;font-display: swap;}
    
    

    The above should help. Please do clear the cache and check and let us know if you still have any further query. Have a nice day ahead.

    Best Regards,
    Nithin

  • Nithin Ramdas
    • Support Wizard

    Hi Michel ,

    Where do i have to put that code exactly then?

    I have already made the changes in your parent Divi themes style.css file. So it should be working fine now.

    [attachments are only viewable by logged-in members]

    and when the theme updates itself, will it still be working?

    Unfortunately, it won’t work once you update the theme. The changes will get lost once the theme is updated. There isn’t any other workaround at the moment other than making the change in the Parent Divi theme side.

    This needs to be fixed within the theme side and if you are looking for a permanent solution you’ll have to bring this into Divi themes supports attention.

    Kind Regards,
    Nithin

  • Michel
    • Design Lord, Child of Thor

    Hi Nithin,

    Allright :slight_smile: that was some misscommunication . i thought i had to putthe css in some file or so . Thanks alot for your help. i have contacted divi support about the issue. i hope they will solve it anytime soon.

    Kind regards,
    Michel

  • lagalga
    • singingmornings

    Could it be this?

    add_action( 'wp_head', 'lagalga_add_preload_tag', 5);
    function lagalga_add_preload_tag()
    {
        echo '<link rel="preload" href="<?php echo get_template_directory_uri(); ?>/core/admin/fonts/modules.ttf" as="font" crossorigin>';
    }
  • Nebu John
    • FLS

    Hi lagalga ,

    I re-checked this at my end, Google Page Speed Insights says Preload key requests passed the audits.

    [attachments are only viewable by logged-in members]

    However, I was able to notice the issue regarding “Ensure text remains visible during webfont load”. On further checking, I found that the CSS change made by Nithin in the styles.css of the Divi parent theme is reverted back. Please note the changes made on the parent theme will be removed once the theme is updated, have you made any recent updates on the theme?

    I have now again replaced the CSS that Nithin mentioned in the initial response. Please do clear the cache and check and if the issue still persists.

    Please get back to us if you need any further clarification.

    Kind Regards,
    Nebu John