Hi @kherlen
If you want to, like me, use your own Google Fonts and remove the default one (Merriweather), you will have to do 2 steps:
1 – Remove the default Merriweather:
Fot that you will have to hack a core file oh this plugin ( /amp/class-amp-post-template.php ). Edit this file and just comment the line below, like this:
/*
'font_urls' => array(
'merriweather' => 'https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic',),
*/
2- Add you own Google fonts: add the snippet below into you wordpress theme functions.php (assuming you are using a child theme…):
add_action( 'amp_post_template_head', 'xyz_amp_add_head' );
function xyz_amp_add_head( $amp_template ) {
?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Quicksand">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway:300">
<?php
}
> Of course the Google Fonts in this exemple are mine, but feel free to add you own…
It Works, and my Amp posts are validated: https://www.domodeco.fr/reportages/visite-privee/maison-a-couper-souffle-dune-pilat.html/amp
Please note that I’m not using anything else that just the AMP Plugin (no Yoast glue, etc.)
PS: in a near future it seems that it will be possible to do it more easily :
https://github.com/Automattic/amp-wp/commit/c60894b6d68055e88210e41d5be6fa7550a5f5db
-
This reply was modified 9 years, 8 months ago by
pako69.
-
This reply was modified 9 years, 8 months ago by
pako69.