Tagged: rtl
-
AuthorPosts
-
April 20, 2014 at 7:23 pm #253604
Hello,
How to enable the RTL option?
I checked this post but still don’t know how to set WordPress to RTL language so that the Enfold RTL stylesheet will be included automatically. https://kriesi.at/support/topic/how-to-enable-the-rtl-option/Thanks
April 20, 2014 at 7:30 pm #253605I used this in wp-config.php file but no change:
define('WPLANG', 'ar_SA');
April 20, 2014 at 8:16 pm #253608Hey!
Afaik ar_SA doesn’t exist (see http://wpcentral.io/internationalization/ ). Try “ar” only and download the right wordpress files: http://ar.wordpress.org/
Cheers!
PeterApril 20, 2014 at 8:53 pm #253612I tried ‘ar’ but it didn’t work.
How do I enable RTL? I don’t want to change the back end, only front end.
April 21, 2014 at 7:03 am #253680Hi!
Thank you for the update.
If you don’t mind, we would like to check the website. Please edit functions.php file, look for this code on line 304:
if ( is_rtl() ) { wp_enqueue_style( 'avia-rtl', $template_url."/css/rtl.css", array(), '1', 'screen' ); }
Replace it with:
wp_enqueue_style( 'avia-rtl', $template_url."/css/rtl.css", array(), '1', 'screen' );
The is_rtl check if wordpress is using another locale language other than default U.S English. Since you don’t want to change the backend, we need to remove that function. Let us know if it works.
Cheers!
IsmaelApril 21, 2014 at 9:58 am #253702But will this still work is I update the theme or WordPress in the future?
April 22, 2014 at 6:01 am #254163Hey!
If you use a child theme you can have this mod and be able to update the theme, this code would need to be added in the child functions.php:
wp_enqueue_style( 'avia-rtl', get_template_directory()."/css/rtl.css", array(), '1', 'screen' );
Best regards,
JosueMay 25, 2014 at 1:20 am #269605Hello,
I did all the above, but it didn’t work.In wp-config.php, I used:
define('WPLANG', 'ar')
I replaced the two lines mentioned by @Ismael with:
wp_enqueue_style( 'avia-rtl', get_template_directory()."/css/rtl.css", array(), '1', 'screen' )
in both enfold and enfold-child themes.
Please help on this issue
Thanks and regards- This reply was modified 10 years, 5 months ago by mndawood.
May 25, 2014 at 1:32 am #269608Hey!
The WPLANG value for Arabic should be:
define('WPLANG', 'ar_AR')
Cheers!
JosueMay 25, 2014 at 2:52 am #269617This reply has been marked as private.May 25, 2014 at 3:16 am #269620Hi!
Look for fonts here:
https://www.google.com/fontsAfter you found the font of your preference, add this to the theme functions.php:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Font Name Here'] = 'Font Name Here:400,600,800'; // <- these are the font weight options return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Font Name Here'] = 'Font Name Here:400,600,800'; // <- these are the font weight options return $fonts; }
Regards,
JosueMay 25, 2014 at 4:00 am #269624Thank you for the help.
I added the code in functions.php of the child theme, and the two fonts show well into the two drop downs; body and heading.I used this in child style sheet:
@import url(https://fonts.googleapis.com/earlyaccess/droidarabickufi.css); @import url(https://fonts.googleapis.com/earlyaccess/droidarabicnaskh.css);
The problem is that the fonts didn’t render into page text at all.
I dont know what might be the cause, I tried many times.Please advise
thank you for your patience.
May 25, 2014 at 4:15 am #269625Hello,
It is done!
Some little typos in the font name; I used apostrophes in place of spaces (like I do in slider font name).
I am pleased you helped me to this fine result.
Thank you very much.
Have a great day, @Josue :)May 25, 2014 at 5:34 am #269632You are welcome, glad we could help :)
Regards,
JosueAugust 30, 2014 at 6:51 pm #311338Hi. It still didn’t work. This is what I did:
in wp-config.php I used:
define('WPLANG', 'ar_AR');
In the child theme, I added this to the child functions.php:
wp_enqueue_style( 'avia-rtl', get_template_directory()."/css/rtl.css", array(), '1', 'screen' );
I also added this:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Droid Arabic Kufi'] = 'Droid Arabic Kufi'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Droid Arabic Kufi'] = 'Droid Arabic Kufi'; return $fonts; }
Why it didn’t work? Still no RTL.
- This reply was modified 10 years, 2 months ago by aymanati.
August 30, 2014 at 6:55 pm #311341August 30, 2014 at 7:40 pm #311356yes:
http://almobadarat.com/site/I can give you access if needed.
August 30, 2014 at 8:46 pm #311374Hey!
The problem seems to be that the rtl stylesheet doesn’t exist on the server – http://almobadarat.com/site/home/mobadara/public_html/site/wp-content/themes/enfold/css/rtl.css?ver=1
I’d suggest re-installing via FTP.
Best regards,
JosueAugust 30, 2014 at 10:06 pm #311400It exists: http://almobadarat.com/site/wp-content/themes/enfold/css/rtl.css
Do you mean this file?
August 30, 2014 at 11:43 pm #311413Try the following; add this code to your functions.php file:
function enqueue_rtl() { wp_enqueue_style( 'avia-rtl', get_template_directory()."/css/rtl.css", array(), '1', 'screen' ); } add_action( 'wp_enqueue_scripts', 'enqueue_rtl', 100 );
August 31, 2014 at 10:28 am #311472Thanks. I added it but it’s not working. I’ll give you access to the website in a next private reply.
August 31, 2014 at 10:29 am #311473This reply has been marked as private.August 31, 2014 at 5:53 pm #311574It’s done, i used this code:
function enqueue_rtl() { wp_enqueue_style( 'avia-rtl', get_template_directory_uri()."/css/rtl.css", array(), '1', 'screen' ); } add_action( 'wp_enqueue_scripts', 'enqueue_rtl', 100 );
August 31, 2014 at 5:58 pm #311575Thanks. RTL is fixed. But the font is not rendered.
I used this
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Droid Arabic Kufi'] = 'Droid Arabic Kufi'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Droid Arabic Kufi'] = 'Droid Arabic Kufi'; return $fonts; }
August 31, 2014 at 6:24 pm #311576Hey!
Try adding this code to the Quick CSS:
body{ font-family: "Droid Arabic Kufi" !important; }
Cheers!
JosueAugust 31, 2014 at 6:28 pm #311578No luck. Didn’t work. Not only the font type, even the font sizes changes are not reflected.
August 31, 2014 at 7:04 pm #311580It’s working now, you had a typo in this code that was blocking all the code below:
#top .av_header_glassy.av_header_transparency #header_main { background-color: rgba(255,255,255,0.6);
Missing “}”.
August 31, 2014 at 10:06 pm #311597Great :)
ThanksAugust 31, 2014 at 10:23 pm #311599You are welcome, glad to help :)
Regards,
JosueAugust 31, 2014 at 11:10 pm #311602Sorry problem again.
I edited an element in the Advanced Styling, then removed it. Now the font type won’t render like before!
-
AuthorPosts
- You must be logged in to reply to this topic.