• Resolved OliverHamburg

    (@oliverhamburg)


    There is a WordPress Multisite setup as
    Blog1
    Blog2

    Blog2 has polylang definitions whilst Blog1 has not

    if (!function_exists( 'pll_the_languagest' ) ) die('polylang not installed');
    switch_to_blog(2);
    pll_the_languages();

    pll_the_languages() and all the other pll_functions do nothing.

    They work only if Blog1 has a setup for polylang as well.

    https://www.ads-software.com/plugins/polylang/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    This is probably one of the biggest multisite trap (not related to Polylang though).

    When you are calling switch_to_blog(2);, you are requesting access to the DB of your site N°2. But you do not load the theme and plugins of the site N°2. Only the theme and plugins loaded before your call are active.

    Thread Starter OliverHamburg

    (@oliverhamburg)

    Oh! Can you give me a hint to load the left things as well?

    Thanks for your excellent, outstanding Plugin, by the way!

    Plugin Author Chouby

    (@chouby)

    If you are meaning to load the plugin with your own code, it won’t work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multisite: First Blog w/o Polylang, 2nd with: pll_* fail’ is closed to new replies.