6

I have two language versions for each of my pages using Polylang plugin. There's a language switcher on every page. But somehow I created two posts not connected to each other (first two in the list). How can I interconnect them so language switcher works properly?

screenshot from Posts window

1
  • It's not really the solution, but more of a workaround. I would just create a new post and translation, copy the content and delete the old two separate posts. Problem solved.
    – Remy
    Jan 19, 2017 at 12:33

3 Answers 3

11

I'll use as example two pages: Hello (en) and Bonjour (fr).

  1. Click "Edit" in page Hello (doesn't really matter which one)
  2. At the right sidebar there will be the language of the current page (English) and a list of flags of other languages with a plus symbol (to create another page) and a text input beside it: Sample page
  3. In this text input, start typing the page title of the translated page (on our example, Bonjour). The input will suggest the other page, just click on it and save, it will link each other.

Source

1
  • this will also work for categories and tags
    – 1NN
    Jan 22, 2021 at 10:20
1

pll_save_term_translations Defines which terms are translations of each other Usage:

pll_save_term_translations($arr);

‘$arr’ => (required) associative array of translations with language code as key and term id as value

https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/

0

You have to set the language for all existing categories and post tags, otherwise they won’t be displayed in the autocomplete input field.

Source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.