-
AuthorPosts
-
May 29, 2013 at 8:57 am #23987
Hello and thanx for a good theme!
How do I add my “own custom font” to the theme? Right now I only can choose between the Google fonts in the backend Enfold admin panel.
May 30, 2013 at 7:01 am #121898I’d recommend to use the font face generator: http://www.fontsquirrel.com/tools/webfont-generator
Then upload the font files into the enfold/css folder and add your font face code to custom.css. Afterwards you can use the font-family attribute to apply the font to any html element: http://www.css3.info/preview/web-fonts-with-font-face/
June 6, 2013 at 9:23 pm #121899Hi Dude!
I´m just wondering if I can add another Google Font to the Option List in the styling section of the admin panel. In fact, i want to add the “Source Sans Pro” Font. http://www.google.com/fonts/specimen/Source+Sans+Pro.
Thanks!
June 8, 2013 at 9:14 am #121900You can use the avf_google_heading_font and avf_google_content_font filter to add a new font weight. Insert following code at the bottom of functions.php:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
function avia_add_heading_font($fonts)
{
$fonts['Source Sans Pro'] = 'Source Sans Pro:400,600,800';
return $fonts;
}
add_filter( 'avf_google_content_font', 'avia_add_content_font');
function avia_add_content_font($fonts)
{
$fonts['Source Sans Pro'] = 'Source Sans Pro:400,600,800';
return $fonts;
}and then select the font from the dropdown. You can also add/remove the font weights by changing the 400,600,800 values.
September 6, 2013 at 4:24 pm #121901Hi, thanks for the help.
I inserted the code to the functions.php file and still can’t find the discussed font. Did I need to do anything else besides adding this code?
Also, is it possible to add this font? http://www.google.com/fonts/specimen/Alef
September 7, 2013 at 5:26 am #121902Hey,
@erantdo: Please try this. Edit functions.php, find this code:
if(isset($avia_config['use_child_theme_functions_only'])) return;
Below, add this code:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
function avia_add_heading_font($fonts)
{
$fonts['Alef'] = 'Alef';
return $fonts;
}
add_filter( 'avf_google_content_font', 'avia_add_content_font');
function avia_add_content_font($fonts)
{
$fonts['Alef'] = 'Alef';
return $fonts;
}Regards,
Ismael
September 7, 2013 at 12:09 pm #121903It works! Thanks :)
-
AuthorPosts
- The topic ‘New custom font.’ is closed to new replies.