• 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.

    http://wordpress.org/plugins/polylang/

Viewing 1 replies (of 1 total)
  • Plugin Author Chouby

    (@chouby)

    To achieve what you want is a bit more complex than this. It is necessary to filter links as well as rewrite rules.

    I may support this in a (quite far) future… as quite a lot of people request it on this forum.

Viewing 1 replies (of 1 total)

The topic ‘Different URLs depending on the language (backend)’ is closed to new replies.