Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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.

    #121898

    I’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/

    #121899

    Hi 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!

    #121900

    You 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.

    #121901

    Hi, 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

    #121902

    Hey,

    @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

    #121903

    It works! Thanks :)

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘New custom font.’ is closed to new replies.