Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #866064

    In working on improving my site’s performance, I’ve been trying to figure out how to move Enfold’s font loading out of the header section and into the footer. This is the solution that I came up with for my child theme, and I wanted to share it with everyone here. I wrote the following code and added it to my child theme’s functions.php:

    function fix_enfold_font_loading()
    {
      $style_generator = $GLOBALS['avia']->style;
      remove_action("wp_head", array($style_generator, 'print_extra_output') ,5);
      add_action("wp_footer", array($style_generator, 'print_extra_output') ,5);
    }
    add_filter('wp_head', 'fix_enfold_font_loading', 4);

    I hope this helps somebody out!

    #866583

    Hey Jonathan,

    Great, thanks a lot for sharing, much appreciated :-)

    Best regards,
    Rikard

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.