Tagged: custom font
-
AuthorPosts
-
June 19, 2017 at 10:36 am #809709
Hello Enfold – I would like to add a custom font ‘Average’ to Enfold.
I have followed some steps in other threads, but they don’t work for me.
What I already have is the css.
@font-face {
font-family: ‘averageregular’;
src: url(‘average-regular-webfont.woff2’) format(‘woff2’),
url(‘average-regular-webfont.woff’) format(‘woff’);
font-weight: normal;
font-style: normal;}
I have put this into the “quick css” option of the Enfold Child theme.
I have put the same code into the “customizer”, but both didn’t work.Can you help me out please?
June 19, 2017 at 3:13 pm #809818if you can not find out the relative path to your fonts – use instead the absolute path to them. This is to keep out of harm’s way.
and a good place for that @font-face rules maybe the style.css of your child-theme
and a good place to upload could be wp-content/uploads/fonts/
i would give each font-family an own folder to keep overview (f.e. for your font : the folder average) – so it could be:@font-face { font-family: ‘averageregular’; src: url(‘https://your.site.url/wp-content/uploads/fonts/average/average-regular-webfont.woff2’) format(‘woff2’), url(‘https://your.site.url/wp-content/uploads/fonts/average/average-regular-webfont.woff’) format(‘woff’); font-weight: normal; font-style: normal; }
if you have http you must modify the url- This reply was modified 7 years, 5 months ago by Guenni007.
June 20, 2017 at 4:16 am #810103Hi,
Thanks for helping out @guenni007, did you try that out and did you have any luck with it @LodiPlanting?
Best regards,
RikardJune 20, 2017 at 7:14 pm #810610Thanks geunni007. I have followed all the steps, but the font still doesn’t show up in the fonts.
Probably I do something wrong, but I have no clue what. Therefore I have added the login details.
Can you have a look please?June 21, 2017 at 6:48 am #810771Hi,
Ok, thanks for the feedback. Could you try following this instead? http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/
Best regards,
RikardJune 21, 2017 at 8:11 am #810827so if it is a google font this might be the best option – and i guess it would be nice to have the other web-font possibilities too: svg, eot, (for some cases ttf) on font squirrell there is a font generator – so if you got f.e. an otf as license you can make there all of these possiblities.
btw for functions.php of your child-theme:
because Average has no other font-weights the code is simple. Then you can use it in enfold options fonts the average font ( at the end of the list)add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Average'] = 'Average'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Average'] = 'Average'; return $fonts; }
June 21, 2017 at 10:18 am #810880Thanks guys. I will follow the thread! Consider this topic as closed!
June 21, 2017 at 11:49 am #810914 -
AuthorPosts
- The topic ‘Add custom font 'Average' to Enfold theme’ is closed to new replies.