@Dim2017

Как установить другой шрифт в шаблон Wordpress?

Здравствуйте. Помогите пожалуйста, не знаю как поменять шрифты в шаблоне Wordpress.
Есть шаблон «ColorNews»
Новый шрифт я создал в «Google Fonts»
dfb1ba7879314be494405f3b9ec5dab6.jpg
Куда вставить эту строку?
В самом шаблоне стоит шрифт «Roboto» - его упоминание я нашел в файле wp-content\themes\colornews\inc\functions.php
выглядит это так:
/**
* Enqueue scripts and styles.
*/
if ( !function_exists('colornews_fonts_url') ) {
// Using google font
// creating the function for adding the google font url
function colornews_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
// applying the translators for the Google Fonts used
/* Translators: If there are characters in your language that are not
* supported by Roboto, translate this to 'off'. Do not translate
* into your own language.
*/
if ( 'off' !== _x( 'on', 'Roboto font: on or off', 'colornews' ) ) {
$fonts[] = 'Roboto:400,300,700,900';
}

// ready to enqueue Google Font
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
), '//fonts.googleapis.com/css' );
}
return $fonts_url;
}
}
  • Вопрос задан
  • 374 просмотра
Решения вопроса 1
llgruff
@llgruff
Scala
Строку вставлять не надо.
В приведенном коде замени:
1. $subsets = 'latin,latin-ext'; на
$subsets = 'cyrillic-ext';
2. $fonts[] = 'Roboto:400,300,700,900'; на
$fonts[] = 'Open+Sans:400,400i,700';
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

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

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