-
AuthorPosts
-
August 14, 2014 at 3:45 pm #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, CarineAugust 15, 2014 at 5:51 am #304728Hey Carine!
Are you using a child theme? if you are not, install this plugin to store this function separately from the parent theme.
Regards,
JosueAugust 15, 2014 at 1:11 pm #304881Thx.
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 15In 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 10 years, 3 months ago by CarineDeville.
August 15, 2014 at 4:46 pm #304986Hi 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,
JosueAugust 16, 2014 at 7:45 am #305208This reply has been marked as private.August 16, 2014 at 8:27 am #305215Hey!
Can you post the website url please?
Best regards,
PeterAugust 16, 2014 at 8:31 am #305216This reply has been marked as private.August 16, 2014 at 8:43 am #305219This reply has been marked as private.August 16, 2014 at 8:52 am #305225Thx a lot, Dude. Could you please explain me what I do wrong?
Thx
CarineAugust 16, 2014 at 8:55 am #305227Hi!
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,
PeterAugust 16, 2014 at 8:58 am #305228Peter,
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;
}August 16, 2014 at 10:00 am #305234Hey!
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 -
AuthorPosts
- You must be logged in to reply to this topic.