Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #703063

    Hi,

    I’m trying to install additional Google Fonts for Enfold.
    Unfortunately I’m only able to break WordPress with that..

    I pasted this code into the functions.php using the “functionality” plugin for wordpress.

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Pathway Gothic One'] = 'Pathway Gothic One:400';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Pathway Gothic One'] = 'Pathway Gothic One:400';
    return $fonts;
    }
    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    return $fonts;
    }

    The following error occurs:
    Fatal error: Cannot redeclare avia_add_heading_font() (previously declared in […]/wp-content/plugins/functionality/functionality.php:76) in […]/wp-content/plugins/functionality/functionality.php on line 94

    #703252

    Hi csuffel!

    I added the code to functions.php file in Appearance > Editor as following

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font_new');
    function avia_add_heading_font_new($fonts)
    {
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    $fonts['Pathway Gothic One'] = 'Pathway Gothic One:400';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font_new');
    function avia_add_content_font_new($fonts)
    {
    
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    $fonts['Pathway Gothic One'] = 'Pathway Gothic One:400';
    return $fonts;
    }

    Please review your website now

    Cheers!
    Yigit

    #703472

    Thank you very much Yigit!

    #703481

    Hi,

    Glad we could help!
    We really appreciate it if you rate our theme on themeforest https://themeforest.net/downloads
    To know more about enfold features please check – http://kriesi.at/documentation/enfold/
    Thank you for using Enfold :)

    Best regards,
    Vinay

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Google fonts w/o Child Theme’ is closed to new replies.