wordpress 中的多个 google 字体无法正常工作

Multiple google fonts in wordpress not working properly

我正在开发一个wordpress网站,想集成多种不同粗细的字体。我为此添加了以下代码:

wp_enqueue_style( 'fonts', '//fonts.googleapis.com/css?family=Montserrat:300,400,700,900|Poppins:300,400,700|Work+Sans:300,400,700,900', array(), null);

现在假设我想使用字体粗细为 400 的 Poppins 字体,然后它不会加载到网站中。相反,字体粗细看起来像 900。

很明显,我知道因为我使用了这么多字体,所以有些字体粗细实际上并没有加载。

正确的做法是什么?如何解决这个问题?我如何设法加载所有这些?

您可以尝试在字体 link 和 false 上添加 http: 而不是 array(),null 吗?

wp_enqueue_style( 'fonts', 'http://fonts.googleapis.com/css?family=Montserrat:300,400,700,900|Poppins:300,400,700|Work+Sans:300,400,700,900', false);