Tagged: font weight, montserrat
-
AuthorPosts
-
May 9, 2022 at 11:42 am #1351033
Hi
Let me start by saying that I’ve been using the Enfold theme for 6-7 years now and produced multiple websites for various clients with Enfold, and I absolutely love the theme.
Normally, if I have any “problems” I can usually Google it as others before me have encountered the same issues before, but this time I’m stuck.
Hopefully the great support team at Enfold can help me. 😊Here’s the thing.
I’ve defined Montserrat as the primary heading font in both “General Styling” under “Fonts” and in “Advanced Styling”.
I’ve also downloaded and installed Montserrat under the “Import/Export” option under “Custom Font Manager”.Despite all this, the preview of my page will not show the correct font weight for the headings.
I’ve never experienced this bebefore.
- This topic was modified 2 years, 6 months ago by Scanmark.
May 10, 2022 at 6:07 am #1351097Hey Scanmark,
Thank you for the inquiry.
The theme only supports the default variation or weight of the Monserrat font but it can be adjusted with a filter. To include the other font weights, try to use this code in the functions.php file.
add_filter( 'avf_google_heading_font', 'avia_add_custom_heading_font'); add_filter( 'avf_google_content_font', 'avia_add_custom_body_font'); function avia_add_custom_heading_font($fonts) { $fonts['Montserrat New'] = 'Montserrat:300,600,800,900'; return $fonts; } function avia_add_custom_body_font($fonts) { $fonts['Google fonts']['Montserrat New'] = 'Montserrat:300,600,800,900'; return $fonts; }
Make sure to select Montserrat New in the fonts settings.
Related thread: https://kriesi.at/support/topic/google-fonts-11/#post-1025744
Best regards,
IsmaelMay 11, 2022 at 2:21 pm #1351375Hi Ismael
Thanks a lot for your reply. :-)
However, even though I’ve designed a lot of web pages with Enfold, I’ve never done any modifications in the functions.php.file, so I’m not 100% sure on how to proceed with this, but I gave it a try.
I’ve added the code you sent me into “Theme functions (functions.php).
I then tried to select Montserrat New from “General Styling” and “Fonts”, but Montserrat New was nowhere to be found there.
I also had look at Advanced Settings to see if the font was present there, but it wasn’t.
I then tried to download the Montserrat font from the Custom Font Manager. That didn’t help either.I’m not sure what to do from here. Could you please advise me further? I’ve sent the necessary login credentials earlier if you need to log into the page to have a look (and clean up my mess).
May 12, 2022 at 8:03 am #1351485Hi,
Thank you for the update.
After adding the filter, you should find the font at the very bottom of the dropdown. Did you check it there?
UPDATE: We moved the filter around line 57 of the functions.php file. You can find the new font as the very last option, after Yellowtail. You may need to install and activate a child theme in order to preserve this modification.
// https://kriesi.at/documentation/enfold/child-theme/
Best regards,
IsmaelMay 12, 2022 at 8:30 am #1351493Hi Ismael
Thanks a lot for your assistance! Now everything looks great.
Best regards
RolandMay 12, 2022 at 9:16 am #1351502Hi,
Great, I’m glad that Ismael could help you out. Note that this modification will be overwritten on updates, please move it into a child theme if you would like to keep it.
Best regards,
RikardMay 12, 2022 at 12:20 pm #1351549Hi Rikard
I will set up a child theme to preserve the modifications. Thanks for great support.
Best regards,
RolandMay 12, 2022 at 1:30 pm #1351560 -
AuthorPosts
- You must be logged in to reply to this topic.