Different URLs depending on the language (backend)
-
Hello, sorry if a similar topic already exists but I don’t found.
I use Polylang for my personal website and I have a small problem with custom posts, in portfolio.
I would like a different URL depending on the language like:
mywebsite.com/work/first-work(in english)
mywebsite.com/projet/premier-projet(in french)By default, the slug ‘work’ is used by my theme. I found the file which manages this slug and I tryed it to change by a new variable $lang_work.
if (get_locale() == 'en-US') $lang_work = 'work'; if (get_locale() == 'fr-FR') $lang_work = 'projet';When I use an echo function of
get_locale(), I see the result en_US or fr_FR.
So that works pretty well but when I add a new custom post in my backend, the slug who used is all the time work.
How can I change the behavior of Polylang for he change the slug when I switch language (English/French) in the box “Languages”.Have you got an idea to fix this problem?
Nicolas.
The topic ‘Different URLs depending on the language (backend)’ is closed to new replies.