How can we help?

If you are looking for support for our PokaTheme, this is the place!

Home Forums PokaTheme support How to load google fonts locally instead of CDN

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17852
    admin
    Keymaster

    Hi Jean-Sebastien,

    To do this, you first need to overwrite through the functions.php of your child theme the poka_dns_prefetch() function and you also have to use WordPress function wp_dequeue_style() to dequeue the “poka-fonts” stylesheet.

    Then you should add some CSS inside the style.css file inside your child theme to include the fonts you have locally.

    This requires a bit of CSS and PHP knowledge. Of course you can always send us an email at support@pokatheme.com for custom functionalities like this one.

    Thanks!

    #17865

    Hey, thanks for the guidelines!

    Problem with overwriting poka_dns_prefetch() function: in setup-theme.php, the function is defined without the usual if ( ! function_exists( ‘poka_dns_prefetch’ ) ) { on top of it,
    so I cannot redeclare the function in the child functions.php.

    Have I another choice but modifying the setup-theme.php and adding if ( ! function_exists( ‘poka_dns_prefetch’ ) ) { so I can redeclare the finctions in the child theme?

    thanks!

    #17868
    admin
    Keymaster

    Hi Jean-Sebastien,

    Unfortunately you are right, we missed to add the function_exists() check for this one, this will be fixed for sure in the next theme release.

    For now, you could use the following PHP snippet in your child theme functions.php to totally remove the stuff that the function poka_dns_prefetch() adds to the site.

    add_action(
    	'init',
    	function() {
    		remove_action( 'wp_head', 'poka_dns_prefetch', 1 );
    	}
    );
    

    Let me know if this works for you.

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