TransWikia.com

How to manually link posts to each other in Wordpress

WordPress Development Asked by Yevheniy8 on January 9, 2021

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

3 Answers

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

Answered by Urel on January 9, 2021

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

Answered by Dinei on January 9, 2021

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/

Answered by Grégoire Sailland on January 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP