@lasthero67

Как на WordPress подключить 2 семейства шрифтов?

В Google Fonts выбираю 2 семейства, Roboto и Roboto Condensed.

https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;700&display=swap


Подключаю их в WordPress

function my_theme_css_and_scripts() {
    wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;700&display=swap', false);
}
add_action( 'wp_enqueue_scripts', 'my_theme_css_and_scripts' );


Но в исходном коде страницы отображается только Roboto.

<link rel='stylesheet' id='google-fonts-css'  href='https://fonts.googleapis.com/css2?family=Roboto%3Awght%40400%3B700&#038;display=swap&#038;ver=5.9' media='all' />


Почему пропадает Roboto Condensed?
  • Вопрос задан
  • 95 просмотров
Решения вопроса 1
AntonLitvinenko
@AntonLitvinenko
HTML coder
Пробуйте вот так
wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;700&display=swap', [], null);
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы