• The popups are not translatable. If I make them translatable with adding the following script to functions.php, still popups in all languages appear at the same time (under each language).

    // PopUp CPT translataple
    add_filter( ‘pll_get_post_types’, ‘add_cpt_to_pll’, 10, 2 );
    function add_cpt_to_pll( $post_types, $is_settings ) {
    if ( $is_settings ) {
    // hides ‘popups’ from the list of custom post types in Polylang settings
    unset( $post_types[‘spucpt’] );
    } else {
    // enables language and translation management for ‘popups’
    $post_types[‘spucpt’] = ‘spucpt’;
    }
    return $post_types;
    }

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Damian

    (@timersys)

    You have latest version of the popups plugin?

    Thread Starter HenriLindeberg

    (@henrilindeberg)

    Yes i have the latest version.

    Thread Starter HenriLindeberg

    (@henrilindeberg)

    Any update on this matter?

    Thanks,
    Henri

    Plugin Author Damian

    (@timersys)

    HI Henri, sorry for the delay. I just tried locally and I only see the popups in the desired language.

    I have popup A in english and spanish and I have popup B just in english.

    I added a language switcher on the sidebar and when I visit the english version I see popup A and B and when I check spanish version I only see popup A.

    Could be the rules or something else?

    Thread Starter HenriLindeberg

    (@henrilindeberg)

    The rules I have are following: “Page Type” “is equal to” “All Pages” AND “Mobile Phone” “is not equal to” “True”.

    Also I need to add code to functions.php to enable translations for PopUp-s. It is not enabled by the plugin itself.
    The code I added to functions.php is the following:

    add_filter( 'pll_get_post_types', 'add_cpt_to_pll', 10, 2 );
    function add_cpt_to_pll( $post_types, $is_settings ) {
    	if ( $is_settings ) {
    		// hides ‘popups’ from the list of custom post types in Polylang settings
    		unset( $post_types['spucpt'] );
    	} else {
    		// enables language and translation management for ‘popups’
    		$post_types['spucpt'] = 'spucpt';
    	}
    	return $post_types;
    }
    Plugin Author Damian

    (@timersys)

    The rules and code looks fine to me. Try disable all plugins (except polylang) to see if any is affecting.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Polylang support not working’ is closed to new replies.