Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #304418

    Hello,
    I tried to add the font “Poiret One” in functions.php. It doesn’t work:

    add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
    function avia_add_heading_font($fonts) {
    $fonts[‘Poiret One’] = ‘Poiret One’;
    return $fonts;
    }
    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts) {
    $fonts[‘Poiret One’] = ‘Poiret One’;
    return $fonts;
    }

    Could you please tell what I do wrong?
    Thx, Carine

    #304728

    Hey Carine!

    Are you using a child theme? if you are not, install this plugin to store this function separately from the parent theme.

    Regards,
    Josue

    #304881

    Thx.
    Indeed, I don’t use a child theme.

    I installed this plugin and added the code. It doesn’t work. I have this message:
    Parse error: syntax error, unexpected T_STRING in /customers/6/6/e/flexihr.com/httpd.www/wp-admin/wp-content/plugins/functions.php on line 15

    In functions.php (not the plugin), I added the font Muli and it works but not with Poiret One. Maybe problem with some kind of google fonts?

    Thx for your help
    Carine

    • This reply was modified 9 years, 8 months ago by CarineDeville.
    #304986

    Hi Carine,

    I tested that and it does work on my end, can you please create me an administrator account? post it here as a private reply.

    Regards,
    Josue

    #305208
    This reply has been marked as private.
    #305215

    Hey!

    Can you post the website url please?

    Best regards,
    Peter

    #305216
    This reply has been marked as private.
    #305219
    This reply has been marked as private.
    #305225

    Thx a lot, Dude. Could you please explain me what I do wrong?
    Thx
    Carine

    #305227

    Hi!

    Tbh I’m not sure. I couldn’t find the code Josue posted in your functions.php file. It was simply missing and thus you couldn’t select the font on the admin page.

    Regards,
    Peter

    #305228

    Peter,

    As I had a fatal error, I moved the code. I had added this code:

    add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
    function avia_add_heading_font($fonts) {
    $fonts[‘Poiret One’] = ‘Poiret One’;
    return $fonts;
    }
    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts) {
    $fonts[‘Poiret One’] = ‘Poiret One’;
    return $fonts;
    }

    #305234

    Hey!

    Ok, the fatal error was probably triggered by the quotes. The php quotes symbol must be:

    
    ' or "
    

    and not

    However glad it works now.

    Regards,
    Peter

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