- Responsive Multi-Purpose Theme Framework! ›
- Forums ›
- Theme Support ›
- Font-family install, not google web font(NanumGothic, Korean)
Hello! Good theme and thank you.
I’d like to use NanumGothic font-family that isn’t a google web font.
I’ve got some font files(.ttf .oft .woff) and some script.
But I am noob so don’t know how the fonts install in this theme.
Wating for answer.
It seems google have those fonts but in early access:
http://www.google.com/fonts/earlyaccess
What i can suggest:
add_action( 'after_setup_theme', "firmasite_remove_googlefonts"); function firmasite_remove_googlefonts(){ add_action( 'customize_register', "firmasite_unsalkorkmaz_remove_setting",11); function firmasite_unsalkorkmaz_remove_setting($wp_customize) { $wp_customize->remove_setting( 'firmasite_settings[font]' ); $wp_customize->remove_control( 'firmasite_settings[font]' ); } add_action( 'wp_enqueue_scripts', "firmasite_unsalkorkmaz_removestyle",11); function firmasite_unsalkorkmaz_removestyle($wp_customize) { wp_dequeue_style( 'google-webfonts' ); remove_action ("wp_head", "firmasite_customcss_googlefont"); } } add_action ("wp_head", "firmasite_custom_googlefont"); function firmasite_custom_googlefont() { ?> <link rel='stylesheet' id='google-nanumgothic-css' href='http://fonts.googleapis.com/earlyaccess/nanumgothic.css' type='text/css' media='all' /> <style type="text/css" media="screen"> body { font-family: 'Nanum Gothic', sans-serif !important;} </style> <?php }
You can use this in a child-theme or as plugin. firmasite_remove_googlefonts function removes Google Fonts option from theme customizer. firmasite_custom_googlefont loads “Nanum Gothic” font. If you still want to use your own font uploads rather then google font, you can use same codes that you just need to create font css that locates your own font files.
Thank you for so fast reply.
I try to your suggest, but it’s not work.
I add above scripts to style.css in FirmaSite-child theme. What’s the worng with me?
oww.. dude.. you cant put those to style.css. Hmm.. You can put those to style.css:
@import url(http://fonts.googleapis.com/earlyaccess/nanumgothic.css); body { font-family: 'Nanum Gothic', sans-serif !important;}
This is much easier but its not a complete solution because this solution will not remove google font option from theme customizer so if you select a google font from theme customizer, it will override your “Nanum Gothic” font. So if you want to use this solution, dont choose any font from theme customizer’s font option.
Thank you!
Now it works by your 2nd suggest.
But, it is not perfect-It has timegap, you said.
So, I re-install child-theme and I’m going to try your 1st suggestion. I need to time for searching.
THANK U!
Np. You can send a review in http://wordpress.org/support/view/theme-reviews/firmasite if you want It means a lot for new users that thinking to use theme.
You must be logged in to reply to this topic.