How to set post ID in Polylang function?

How to set post ID in Polylang function?

‘post_id’ => if set, displays links to translations of the post (or page) defined by post_id (default: null) ‘raw’ => use this to create your own custom language switcher (default:0) Important: You have to output yourself the ul tags if you don’t use the dropdown option.

Is it possible to query a different language in Polylang?

Polylang does set the language of the theme based on the main query, but it is possible to query content in a different language. For example, you can display the list of the five most recent French posts on an English page. Your custom query just needs to add the ‘lang’ parameter.

Which is the function to return the language name in Polylang?

Additionaly, Polylang now provides the function ‘pll_current_language’ which can return either the language code, the locale or the language name.

What can you do with Polylang plugin for WordPress?

Polylang allows you to create a bilingual or multilingual WordPress site. You write posts, pages and create categories and post tags as usual, and then define the language for each of them. The translation of a post, whether it is in the default language or not, is optional. You can use as many languages as you want.

Where do I find the code for Polylang?

Important: When using the language switcher as a dropdown, you must provide yourself the action attached to the language switching. If you want the same comportment as provided by the widget, you can find the corresponding code in the file polylang/include/widget.php.

How to hide the current language in Polylang?

‘hide_if_no_translation’ => hides the language if no translation exists if set to 1 (default: 0) ‘hide_current’=> hides the current language if set to 1 (default: 0) ‘post_id’ => if set, displays links to translations of the post (or page) defined by post_id (default: null)

Which is the unique parameter in Polylang function?

The unique parameter is required: Translates a string previously registered with pll_register_string in a given language. Unlike ‘pll__ ()’ and ‘pll_e ()’ which allow to get the translation only in the current language (as do the WordPress localization functions ‘__ ()’ and ‘_e ()’), this function allows to get the translation in any language.