I’m trying to add languages to my wordpress driven website and i installed xili-languages plugin. Unfortunately it uses lang param to differentiate between languages and i rather have seen something like http://domain.com/cn/article-in-chinese/ rather than http://domain.com/article-in-chinese/?lang=cn
Leave a Reply
You must be logged in to post a comment.
Set permalink to (Post Name)
or
Add following code to
functions.php
of your theme:You would like to write:
http://domain.com/cn/article-in-chinese/
so that wordpress understand :
http://domain.com/article-in-chinese/?lang=cn
.I think it will be easier to use
http://domain.com/article-in-chinese/lang/cn/
. You need to write a new rule and a new tag in WP rewrite rules (WordPress write those rules in your htaccess) with the functions add_rewrite_rules() and add_rewrite_tag().