Created
September 8, 2025 14:45
-
-
Save Jehu/5d7327766bc2c562bd8eabb63ca6d259 to your computer and use it in GitHub Desktop.
Use MA Custom Fonts Script with EtchWP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 1) Download the Script from https://www.altmann.de/en/blog-en/code-snippet-custom-fonts/ | |
* 2) Add this to line 395 | |
*/ | |
// Etch: Add custom fonts CSS to Etch Builder preview | |
add_filter('etch/preview/additional_stylesheets', function ($stylesheets) { | |
if ($this->css_output == 'file') { | |
$css_path = $this->fonts_base->dir . '/' . self::SLUG . '.css'; | |
if (file_exists($css_path)) { | |
$stylesheets[] = [ | |
'id' => self::SLUG, | |
'url' => $this->fonts_base->url_full . '/' . self::SLUG . '.css' | |
]; | |
} | |
} | |
return $stylesheets; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment