Skip to content

Instantly share code, notes, and snippets.

@Jehu
Created September 8, 2025 14:45
Show Gist options
  • Save Jehu/5d7327766bc2c562bd8eabb63ca6d259 to your computer and use it in GitHub Desktop.
Save Jehu/5d7327766bc2c562bd8eabb63ca6d259 to your computer and use it in GitHub Desktop.
Use MA Custom Fonts Script with EtchWP
/**
* 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