Vitajte na [www.pocitac.win] Pripojiť k domovskej stránke Obľúbené stránky
1. Prihláste sa do hlavného panela WordPress.
2. Kliknite na Vzhľad -> Editor tém .
3. V pravom paneli kliknite na Funkcie témy (functions.php) súbor.
4. Skopírujte a prilepte nasledujúci kód do súboru functions.php:
```php
/*
* Zakázať písma Google
*/
add_filter( 'wp_resource_hints', 'disable_google_fonts_resource_hints', 10, 2);
function disable_google_fonts_resource_hints( $urls, $relation_type ) {
if ( wp_style_is( 'google-fonts' ) ) {
$urls =remove_element_by_value( $urls, 'https://fonts.gstatic.com' );
}
vrátiť $urls;
}
/*
* Odstráňte odkaz Google Fonts z
*/
remove_action( 'wp_head', 'wp_resource_hints', 2);
/*
* Odstráňte písma Google z rozhrania WordPress Embed API
*/
add_filter( 'embed_oembed_html', 'disable_google_fonts_oembed_filter', 10, 4);
function disable_google_fonts_oembed_filter( $html, $post_id, $width, $height ) {
if ( wp_style_is( 'google-fonts' ) ) {
$html =preg_replace( '/https:\/\/fonts.gstatic.com\/s\/.+?\/_.+?\//', '', $html );
}
návrat $html;
}
/*
* Pomocná funkcia na odstránenie prvku z poľa
*/
function remove_element_by_value($array, $value)
{
$index =pole_search($hodnota, $pole);
if ($index !==false) {
unset($array[$index]);
}
return $array;
}
```
5. Kliknite na Aktualizovať súbor aby sa zmeny uložili.
Písma Google budú teraz na vašom webe WordPress zakázané.