-
AuthorPosts
-
October 3, 2016 at 1:11 pm #694574
I want to define a new font for all headings and bodies which is not included in the font list;
I have 2 question about it:
1- I want to add “playfair display”-font. Is the follownig code correct?
add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
function avia_add_heading_font($fonts)
{
$fonts[‘Playfair Display’] = ‘Playfair Display Narrow:400,700’;
$fonts[‘Playfair Display’] = ‘Playfair Display:400,700,400italic,700italic’;
return $fonts;
}add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
function avia_add_content_font($fonts)
{$fonts[‘Playfair Display’] = ‘Playfair Display:400,700,400italic,700italic’;
$fonts[‘Playfair Display Narrow’] = ‘Playfair Display Narrow:400,700’;
return $fonts;
}2-On Enfold has 2 Function.php. Which one should mentioned code add to?
– wp-content/themes/enfold/functions.php
or
– wp-includes/functions.phpOctober 3, 2016 at 1:14 pm #694579Hi tennetno!
Please edit functions.php file and find following line
if(isset($avia_config['use_child_theme_functions_only'])) return;and place your code right below that line
Cheers!
YigitOctober 3, 2016 at 1:31 pm #694583Thanks Yigit,
I’ve placed it but this error appears when you open http://www.webpluss.no/
Parse error: syntax error, unexpected ‘Display’’ (T_STRING), expecting ‘]’ in /customers/4/a/1/webpluss.no/httpd.www/wp-content/themes/enfold/functions.php on line 22
Would you check the code?
October 3, 2016 at 1:36 pm #694587October 3, 2016 at 1:43 pm #694596Thanks man!
October 3, 2016 at 1:49 pm #694599October 3, 2016 at 2:12 pm #694617Thanks a lot! :)
-
AuthorPosts
- The topic ‘Define a new font’ is closed to new replies.
