I want to get the language prefix from url with Wordpress, but I don't know how.
if I have the following url http://sitename.com/ru/about-us
, I want to get the full path including /ru/
, but whatever I try i don't get it ,e.g
$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']
I am using qTranslate plugin, and my site it multilanguage
I just want to check if the url link has language prefix after host name, I can do that if i get the whole url, but I can't get it, anybody can help me?
You can easily do that with Permalinks option from your WP dash board. Go to Settings > Permalinks. Select Custom Structure and add this line
/ru/%postname%/
.