Tagged: adding font, custom font, font
-
AuthorPosts
-
May 30, 2015 at 8:26 pm #452067
Stuck trying to add my own fonts, Proxima Nova for body & Charter BT headings
searched many threads inc. https://kriesi.at/support/topic/own-web-font/
environment:
English only
shared host
child theme
newest all upd.
no plugins.
No cloudflare, no cache.
clean theme/install no custom CSS or mods, etc.Generated CSS from font face gen.
added this to quick CSS changed to absolute paths (domain changed here):
(single example)@font-face {
font-family: ‘CharterBTRoman’;
src: url(‘http://mywebsite.com/wptest/fonts/CharterBTRoman.eot’);
src: url(‘http://mywebsite.com/wptest/fonts/CharterBTRoman.eot’) format(’embedded-opentype’),
url(‘http://mywebsite.com/wptest/fonts/CharterBTRoman.woff2’) format(‘woff2’),
url(‘http://mywebsite.com/wptest/fonts/CharterBTRoman.woff’) format(‘woff’),
url(‘http://mywebsite.com/wptest/fonts/CharterBTRoman.ttf’) format(‘truetype’),
url(‘http://mywebsite.com/wptest/fonts/CharterBTRoman.svg#CharterBTRoman’) format(‘svg’);checked paths to see if they work, they do.
Changed to websafe default on child options.
all defalt CSS for google fonts is still showing in code for pages/posts after I do this.
and font has not changed in any browser- tried several and cleared cache, etc.
what am I missing?
May 31, 2015 at 4:21 am #452119Hey!
Try adding this at the very end of your theme / child theme functions.php file:
/* Add custom font to heading/content settings (General Styling > Fonts & Advanced Style Editor ) */ add_filter( 'avf_google_heading_font', 'avia_add_custom_font'); add_filter( 'avf_google_content_font', 'avia_add_custom_font'); function avia_add_custom_font($fonts) { $fonts['CharterBTRoman'] = "CharterBTRoman"; return $fonts; } /* Disable Google Font embedding */ add_action( 'init', 'enfold_customization_switch_fonts' ); function enfold_customization_switch_fonts() { global $avia; $avia->style->print_extra_output = false; }
Cheers!
Josue -
AuthorPosts
- You must be logged in to reply to this topic.