Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #186785

    Hi
    I found here
    https://kriesi.at/support/topic/new-custom-font/
    how to add a custom font.

    Now i would like to use another google font, just for the h1 tags.

    So i got this google font:
    http://www.google.com/fonts#UsePlace:use/Collection:Indie+Flower
    Where do i place the code from “3. Add this code to your website:” ?

    Thanks for answers

    #187490

    Hey wesdacar!

    You should add new font as you did previously https://kriesi.at/support/topic/new-custom-font/#post-121900

    Cheers!
    Yigit

    #187647

    When i try to add a second font like this:

    add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
    function avia_add_heading_font($fonts)
    {
    $fonts[‘Tinos’] = ‘Tinos:400,700’;
    return $fonts;
    }

    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts)
    {
    $fonts[‘Tinos’] = ‘Tinos:400,700’;
    return $fonts;
    }

    add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
    function avia_add_heading_font($fonts)
    {
    $fonts[‘Indie_Flower’] = ‘Indie+Flower’;
    return $fonts;
    }

    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts)
    {
    $fonts[‘Indie_Flower’] = ‘Indie+Flower’;
    return $fonts;
    }

    then i got a “500 server error” and the pages don’t load anymore.

    how is the proper way to add multiple google fonts?

    #188193

    Hey!

    Please add this on your functions.php:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Indie Flower'] = 'Indie Flower';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Indie Flower'] = 'Indie Flower';
    return $fonts;
    }

    There are lots of h1 elements on the theme. You can apply the font on your Quick CSS or custom.css:

    h1 {
    font-family: 'Indie Flower', cursive !important;
    }

    Regards,
    Ismael

    #188305

    Thanks Ismael.
    I think i didn’t explain well what my issue is.

    When i’m adding 1 font that way, there is no problem,
    Just when i add a second font with the same code, below the code from the first font,( like in the example in my post above)
    then the pages on my website do not load anymore.

    #189240

    Hi!

    I believe the proper syntax would be:

    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Indie Flower'] = 'Indie Flower';
    $fonts['Indie Flower'] = 'Indie Flower';
    $fonts['Indie Flower'] = 'Indie Flower';
    $fonts['Indie Flower'] = 'Indie Flower';
    
    return $fonts;
    }

    Where each new line is a new font that gets added to $fonts.

    Regards,
    Devin

    #189844

    Yo Devin
    That works fine.
    Thanks a lot.
    Cheers

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