
Diese Seite ist derzeit nicht verfügbar.
Diese Information wird zeitnah verfügbar werden.
Vielen Dank für Ihr Verständnis!
Grüsse Heiko
Das Hinzufügen von benutzerdefinierten Google Fonts in den Divi Builder ist einfacher, als du vielleicht denkst. Mit dieser Anleitung zeige ich dir, wie du Google Fonts Schritt für Schritt hochlädst und in deinem Divi-Projekt verwendest.
Zuerst brauchst du die gewünschten Schriftarten auf deinem Computer. Gehe dazu auf die folgende Website:
Um die Schriftarten in den Divi Builder hochzuladen, musst du bestimmte Dateiformate erlauben. Dazu kannst du entweder das Code Snippets Plugin nutzen oder direkt in deinem Child-Theme arbeiten.
functions.php
-Datei deines Divi Child-Themes.
global $da_allowed_mimes;
$da_allowed_mimes = ['ttf' => 'application/x-font-ttf', 'otf' => 'application/x-font-otf', 'woff' => 'application/x-font-woff', 'woff2' => 'application/x-font-woff2'];
/**
* Allow Custom Mime
*
* @param $mimes
*
* @return mixed
*/
if (!function_exists('pac_da_upload_mimes')):
function pac_da_upload_mimes($mimes)
{
global $da_allowed_mimes;
foreach ($da_allowed_mimes as $key => $val) {
$mimes[$key] = $val;
}
return $mimes;
}
endif;
/**
* Allow Divi To Upload Fonts Format
*
* @return string[]
*/
if (!function_exists('pac_da_filter_divi_supportedt_font_formats')):
function pac_da_filter_divi_supportedt_font_formats()
{
return ['otf', 'woff', 'woff2', 'ttf'];
}
add_filter('et_pb_supported_font_formats', 'pac_da_filter_divi_supportedt_font_formats', 999);
endif;
/**
* Fixes the issue in WordPress 4.7.1 being unable to correctly identify type
*
* @param $file
* @param $tmp_file
* @param $filename
* @param $mimes
*
* @return array|mixed|null
*/
if (!function_exists('pac_da_fix_mime_type_ext')):
function pac_da_fix_mime_type_ext($file, $tmp_file, $filename, $mimes)
{
if (isset($file['ext']) && empty($file['ext'])) {
$file_ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
global $da_allowed_mimes;
foreach ($da_allowed_mimes as $key => $val) {
if ($key === $file_ext) {
$file['ext'] = $key;
$file['type'] = $val;
}
}
}
return $file;
}
endif;
if (current_user_can('administrator')) {
add_filter('upload_mimes', 'pac_da_upload_mimes');
add_filter('wp_check_filetype_and_ext', 'pac_da_fix_mime_type_ext', 75, 4);
}
Um die Schriftarten direkt hochzuladen, kannst du folgende Schritte ausführen:
Falls du weitere Unterstützung benötigst, findest du in meinem Blog eine ausführliche Schritt-für-Schritt-Video Anleitung. Viel Erfolg mit deinen neuen Schriftarten!
Viel Spaß beim Gestalten mit deinen neuen Schriftarten!
Nutzen Sie jetzt die Möglichkeit einer telefonischen Erstberatung – schnell, unverbindlich und kompetent!
Benötigen Sie ein Bewerbungsformular für Ihre Webseite? Ich erstelle benutzerfreundliche und professionelle Formulare, die perfekt auf Ihre Anforderungen abgestimmt sind.
0 Kommentare