Tagged: x
-
AuthorPosts
-
March 19, 2017 at 6:48 am #1412688
hi,
i use face fonts for displaying Hebrew text.
in some pages i need to display text in English. i want to use “Lato” font that comes with your theme.
how can i set it to display lato whenever English is Used?
this is the site’s URL: http://www.danon.org.il (ex: http://www.danon.org.il/syindia/)
Thanks, Meir
March 19, 2017 at 10:40 pm #1413200Hello Meir,
Thanks for writing in! To resolve your issue, since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.
// Change font stack if English // ============================================================================= function change_font_stack($lang){ if ( get_locale() != 'he_IL') { $lang = 'Arial'; } var_dump($lang); return $lang; } add_filter('x_option_x_body_font_family', 'change_font_stack'); add_filter('x_option_x_headings_font_family', 'change_font_stack'); // =============================================================================
We would loved to know if this has work for you. Thank you.
March 20, 2017 at 2:26 am #1413305hi,
thanks, It doesn’t seem to do anything…
thanks again, Meir
March 20, 2017 at 8:25 am #1413601Hi Meir,
Please try to update the code to:
// Change font stack if English // ============================================================================= function change_font_stack($lang){ if ( get_locale() != 'he_IL') { $lang = 'Lato'; } var_dump($lang); return $lang; } add_filter('x_option_x_body_font_family', 'change_font_stack'); add_filter('x_option_x_headings_font_family', 'change_font_stack'); // ============================================================================= add_action( 'wp_enqueue_scripts', 'gf_scripts' ); function gf_scripts() { wp_enqueue_style( 'gf-google-font', 'https://fonts.googleapis.com/css?family=Lato' ); }
Hope this helps.
March 20, 2017 at 11:50 am #1413886Sorry Jade, Still doesn’t work 🙁
March 20, 2017 at 2:27 pm #1414084Hi again,
Please try updating the previous code with the following code:
// Change font stack if English // ============================================================================= function change_font_stack($lang){ if ( get_locale() != 'he_IL') { $lang = 'Lato'; } var_dump($lang); return $lang; } add_filter('x_option_x_body_font_family', 'change_font_stack'); add_filter('x_option_x_headings_font_family', 'change_font_stack'); // ============================================================================= add_action( 'wp_head', 'gf_scripts' ); function gf_scripts() { <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css"> }
Let us know how this goes!
-
AuthorPosts