I am using qTranslate plugin with my WordPress site and now I have to detect the active language in the themes functions.php file. The detection function qtrans_getLanguage()
is working, however, it always shows the default language (en) as active, even though I have it switched in the page itself. How can I detect the language in function file?
Leave a Reply
You must be logged in to post a comment.
This worked for me:
Notice that this has changed in qTranslate X (the new version):
There is also some compatibility functions in the plugin options according to this
To apply this code you need some PHP knowledge, it is used to translate exact parts of your WordPress Theme
use this :
replace ‘ar’ with yours