Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #601848

    Hello guys,

    I’m using Enfold with Lato google font and I’d like to add latin-extended subset.

    I found similar topic ( https://kriesi.at/support/topic/google-fotns-with-extended-latin-subset/ ) and I tried applying the same solution, but no luck.

    
    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext';
    return $fonts;
    }
    

    I added this chunk to child-theme’s function.php, but nothing happened. Then I moved it to enfold function.php right after

    
    $avia_config['color_sets'] = array(
        'header_color'      => 'Logo Area',
        'main_color'        => 'Main Content',
        'alternate_color'   => 'Alternate Content',
        'footer_color'      => 'Footer',
        'socket_color'      => 'Socket'
     );
    

    and the app was broken – I got the following error:

    Fatal error: Cannot redeclare avia_add_heading_font() (previously declared in /home/acirs/public_html/content/themes/ACI/functions.php:9) in /home/acirs/public_html/content/themes/enfold/functions.php on line 54

    What am I doing wrong? :)

    • This topic was modified 8 years, 9 months ago by borkosavic.
    #601948

    Hey borkosavic!

    Please change your code to following one

    add_filter( 'avf_google_heading_font',  'avia_new_add_heading_font');
    function avia_new_add_heading_font($fonts)
    {
    $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_new_add_content_font');
    function avia_new_add_content_font($fonts)
    {
    $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext';
    return $fonts;
    }

    You cannot declare the same function twice changing the function name should fix the error

    Best regards,
    Yigit

    #602032

    No luck – extra characters are still being shown differently

    #602035

    Hi!

    Can you please try adding following code to Functions.php file as well

    function add_subset_func($fontlist) {
    	$fontlist .= "&subset=latin,latin-ext";
    	return $fontlist;
    }
    add_filter('avf_google_fontlist', 'add_subset_func');

    Best regards,
    Yigit

    #602105

    This is my child-theme functions.php:

    <?php
    
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file. 
    * WordPress will use those functions instead of the original functions then.
    */
    
    add_filter( 'avf_google_heading_font',  'avia_new_add_heading_font');
    function avia_new_add_heading_font($fonts)
    {
    $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_new_add_content_font');
    function avia_new_add_content_font($fonts)
    {
    $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext';
    return $fonts;
    }
    
    function add_subset_func($fontlist) {
    	$fontlist .= "&subset=latin,latin-ext";
    	return $fontlist;
    }
    add_filter('avf_google_fontlist', 'add_subset_func');

    Still no luck

    #602384

    Hi,

    Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.

    Thanks,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.