-
AuthorPosts
-
April 2, 2016 at 1:00 pm #606955
Hi! What part of “Enfold Theme Options” controls the font of the main menu (where to change the font) ? Thanks!
April 2, 2016 at 1:15 pm #606956Sorry, found it!
April 3, 2016 at 9:01 am #607173April 3, 2016 at 7:15 pm #607255I read a lot of threads here on how to add extra google fonts, including this article: http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/ . Got confused because most of the threads contain a lot of multiple information. I also read,if I’m not mistaken, that this entry in child theme’s functions.php will add the font family and not the specific font type (bold, italic etc).
I would like to add “Cardo Normal 400 Italic” and later use it for my main header menu by selecting it in “Advanced Styling” Theme options.
Could you please walk me through the steps?
April 4, 2016 at 7:18 am #607404Hi,
The documentation walks you through pretty well I think, where did you encounter problems and what code did you try?
Regards,
RikardApril 4, 2016 at 7:31 pm #607813Hi Rikard,
Since I don’t understand anything in all these codes, I usually don’t proceed with something when I’m confused and try to get more information before acting :)I went ahead and tried inserting this in my child’s theme functions.php file:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Cardo 400italic'] = 'Cardo:400italic'; return $fonts; }
It seems that it worked.
I would appreciate if you could still clarify a few things for me:
1) http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/
The example has the same stuff written twice, only the order of font families is changed. I guess it’s done for the sake of example and I only need to have it written once, correct ?
Or do I actually need to insert it twice as stated in the example?2) To better understand the functionality I tried entering the exact example from the documentation.
$fonts[‘PT Sans’] = ‘PT Sans:400,700,400italic,700italic’;
This entry it states 4 different font weights/styles at once.
– How do I select winch font wight/style I want to use when selecting PT Sans font in “Advanced Styling” options?
– What’s the purpose of specifying 4 different weights at once ?Many thanks!
April 6, 2016 at 10:36 am #608798Hi!
1.) It’s not the same stuff, it’s different, so use it exactly like this.
2.) The purpose is that you can choose between 4 different font weights this way. You can’t select a specific font to style in advanced styling settings. Tell us what you want to achieve exactly and we help to do it.
Best regards,
AndyApril 6, 2016 at 6:40 pm #6091081) Not sure what to do with this 2 lines:
$fonts[‘PT Sans Narrow’] = ‘PT Sans Narrow:400,700’; ( I changed this to $fonts[‘Cardo 400italic’] = ‘Cardo:400italic’; )
$fonts[‘PT Sans’] = ‘PT Sans:400,700,400italic,700italic’; ( I erased this line )Is this the correct way (below) ?
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Cardo 400italic'] = 'Cardo:400italic'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Cardo 400italic'] = 'Cardo:400italic'; return $fonts; }
2) Can I make it selectable by writing out and naming each font weight individually ?
April 7, 2016 at 12:50 pm #609545Hey!
1.) Looks good, so just try it and let us know if you still need help with it afterwards.
2.) Not sure what you mean by “writing out and naming each font weight individually”, but as shown here you can include different font weight inside the code at the same time.
Best regards,
AndyApril 7, 2016 at 2:35 pm #609645Hi!
1) How do I specify multiple fonts at once ?
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Cardo 400italic'] = 'Cardo:400italic'; $fonts['PT Sans Narrow 400'] = 'PT Sans Narrow:400'; $fonts['PT Sans700'] = 'PT Sans:700'; $fonts['PT Sans400'] = 'PT Sans:400'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Cardo 400italic'] = 'Cardo:400italic'; $fonts['PT Sans Narrow 400'] = 'PT Sans Narrow:400'; $fonts['PT Sans700'] = 'PT Sans:700'; $fonts['PT Sans400'] = 'PT Sans:400'; return $fonts; }
Correct ?
April 7, 2016 at 2:37 pm #609649April 7, 2016 at 2:41 pm #6096562) Andy wrote “You can’t select a specific font to style in advanced styling settings”. What I meant is that I want to be able to select each weight font in the styling settings. How do I achieve that ?
Do I name and write out each one individually, like I did in post my post #609645 ?April 7, 2016 at 2:44 pm #609660Hi!
You can add following code to Quick CSS in Enfold theme options under General Styling tab and adjust the value as needed
.av-main-nav > li > a { font-weight: 100; }
Please make sure that > sign is not converted to – http://i.imgur.com/IDXRZQ3.png in Quick CSS field.
Regards,
YigitApril 7, 2016 at 2:49 pm #609663Can I just do it as written in post #609645 ?
April 7, 2016 at 2:55 pm #609669Hi!
Sure, you can use 400 or 700 and/or italic as following
.av-main-nav > li > a { font-weight: 700; font-style: italic; }
Best regards,
YigitApril 7, 2016 at 3:01 pm #609672Sorry, I’m confused now.
Where do I specify the font’s name ? I would like them all to appear in settings->”advanced styling ”
Is it necessary to use this code for Quick CSS when I already edited functions.php file with this entries:
$fonts[‘Cardo 400italic’] = ‘Cardo:400italic’;
$fonts[‘PT Sans Narrow 400’] = ‘PT Sans Narrow:400’;
$fonts[‘PT Sans700’] = ‘PT Sans:700’;
$fonts[‘PT Sans400’] = ‘PT Sans:400’;?
Thank you for your help!April 7, 2016 at 3:10 pm #609682Hi!
The code you used here – https://kriesi.at/support/topic/main-menu-font-type/#post-609645 adds new font families/font weights to the theme that you can use in Advanced Styling tab of Enfold theme options. After choosin font family in Enfold theme options, you can use custom CSS code i posted here – https://kriesi.at/support/topic/main-menu-font-type/#post-609669 to change font weight and style
Cheers!
YigitApril 7, 2016 at 3:16 pm #609689Clearer, thank you !
Can I just name each for weight individually like this (where I name each font+wight separately) and NOT use Quick CSS:
$fonts[‘PT Sans700’] = ‘PT Sans:700’;
$fonts[‘PT Sans400’] = ‘PT Sans:400’;And not like this , where all wights specified at once:
$fonts[‘PT Sans’] = ‘PT Sans:400,700,400italic,700italic’;Sorry for being annoying :)
April 11, 2016 at 5:03 am #610936 -
AuthorPosts
- You must be logged in to reply to this topic.