Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #614058

    Hi.
    Please read this carefully!

    i have read all topics about adding custom font to enfold theme. adding Google font or Custom self hosted font. i am familiar with Font face and i can generate font face from my self hosted font and use it in quick css or add it to custom.css but in this way i have a problem that is described as below:

    my second language of website is Persian and ENFOLD theme support persian language files (.po, .mo) but google fonts added to enfold are arabic and there is a few standard Persian fonts for web. in the above method i must change any header, menu. shortcode and anything that use default fonts to my self hosted font that is not Good way!!! so when i used layout builder to make pages i need to add qustom css codes to load my owned fonts in layout builder elements such as icon list, captions and etc.
    in this way i must setup new css file for all of the font-families that is used in original enfold theme.

    i need a method to add my self hosted font into font selection dropdown in enfold settings to change fonts to any desired section simply.
    if there is not any method can i send the fonts for enfold team to add them into Enfold for all persian users.

    what is your solution?

    thank you.

    #616197

    Hi Bahar!

    Thank you for using Enfold.

    Set the font family in the body tag:

    html[lang="fa-IR"] body {
        font-family: 'Custom Font', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    }

    It will affect almost any elements in the theme excluding the heading tags. And it will only affect pages in the persian language.

    Regards,
    Ismael

    #616225

    Hi Ismael,
    thank you for your reply.
    i will add this to custom.css style sheet. and everything was ok. but i need a few changes.
    i want to load Persian fonts only in the Persian language. this means custom.css will load my fonts if the site language is another. how can i load or make any css file to load only in Persian language? same as RTL.css behavior.
    and second: if i want to set font family to headings and etc how can i use [lang=”fa-IR”] in my styles to exclude other languages from change effects?
    for example can i use this code:

    html[lang=”fa-IR”] h1,h2,h3 {
    font-family: ‘Custom Font’, ‘HelveticaNeue’, ‘Helvetica Neue’, Helvetica, Arial, sans-serif;
    }

    thank you

    #617506

    Hey!

    you can use WPML plugin.

    Regards,
    Andy

    #684419

    Hi Bahar,
    Page body in RTL languages have an “rtl” class so you can use ‘rtl’ class for element parents in css.
    But guys my client wants to change fonts in admin panel enfold settings anytime he wants, is there any solution to do this?

    #684697

    Hi @iranmiz,

    Thanks for sharing that, much appreciated :-)

    About the font change in the admin panel, there’s nothing like that in our themes unfortunately, I think you will have to look for a plugins which adds that functionality.

    Best regards,
    Rikard

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