hardcode language choice in the theme
-
Hi. I installed a theme that has an RTL (Right to Left) stylesheet to use on my RTL, Arabic blog. The documentation of the theme said the RTL style will be automatically loaded in an RTL blog. My blog is RTL, Arabic.But the RTL style didn’t load, instead, the default, LTR one.
I made sure I have “”define ('WPLANG', 'ar_AR');
“” in the wp-config file. But still didn’t help.I installed the plugin WordPress Languages, and using it, I changed the front end language to Arabic, and then the RTL style was loaded fine.
But I do not want to use a plugin, I want to hardcode that into my WordPress, How can I do it?This info might help:
when the WordPress Languages plugin isn’t active, and the RTL of the theme isn’t loaded, the index’s source shows this,
<!DOCTYPE html> <html lang="ar-AR" prefix="og: https://ogp.me/ns# fb: https://ogp.me/ns/fb#"> <head> <meta charset="UTF-8" />
when the WordPress Languages plugin IS active, and I chose English as the front-end language, (so the RTL of the theme isn’t loaded), the index’s source shows this,
<!DOCTYPE html> <html lang="en-US" prefix="og: https://ogp.me/ns# fb: https://ogp.me/ns/fb#"> <head> <meta charset="UTF-8" />
when the WordPress Languages plugin IS> active</strong, and I chose ARABIC as the front-end language, (so the RTL of the theme IS loaded), the index’s source shows this:
<!DOCTYPE html> <html dir="rtl" lang="ar" prefix="og: https://ogp.me/ns# fb: https://ogp.me/ns/fb#"> <head> <meta charset="UTF-8" />
- The topic ‘hardcode language choice in the theme’ is closed to new replies.