Support » Plugin: Polylang » Polylang stops p2

  • I put p2
    Post: Can
    Post posted: yes
    On refresh: I see it

    I put polylang and put 3 languages so for each language there would be different language.
    Post: Can
    Post posted: yes
    On refresh: I dont see it

    It turns out that it doesnt auto gets language so its published without language and when they are without language they are not seenable on blog.
    What to do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • 1. Post name
    2. Didnt changed Default home page- showing posts on each language
    3. 3 languages, Menus without lang, Dont check user browser lang, Default lang set, The lang is set from content, dont show /language/ in PP, Allow to sync cats tags.

    U can check my page and post i put there so that everyone can post without reg.

    I tried and that works a bit with polylang. It posts to default lang so if i change it post goes to that lang. So how to make it work allways can maybe found in that code? Heres my example page with that plugin working.
    If im in different lang then default i post and it pops up in place i am but on reloud its not there anymore but in default lang i can see it.

    Plugin Author Chouby


    For now Polylang can set the language of a post only from backend. So it means that P2 needs some adaptations. You can include this in a custom plugin:

    add_action('save_post', 'pll_p2_save_post', 5);
    add_action('create_term', 'pll_p2_save_term', 5);
    add_action('edit_term', 'pll_p2_save_term', 5);
    function pll_p2_save_post($post_id) {
    	global $polylang;
    	if (isset($polylang) && !$polylang->get_post_language($post_id) && isset($_COOKIE['wordpress_polylang']))
    		$polylang->set_post_language($post_id, $_COOKIE['wordpress_polylang']);
    function pll_p2_save_term($term_id) {
    	global $polylang;
    	if (isset($polylang) && !$polylang->get_term_language($term_id) && isset($_COOKIE['wordpress_polylang']))
    		$polylang->set_term_language($term_id, $_COOKIE['wordpress_polylang']);

    This should be a good starting point to make P2 multilingual. However, it won’t solve all the issues. At least, the autocomplete tags form will display tags in all languages.

    Where do i put that? Im searching for string ‘save_post’ and only found it in themes\p2\js\p2.js but still there dont know where to change what.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Polylang stops p2’ is closed to new replies.