• I have 100+ posts in language A, and 1 post in lang B.

    I am using:
    pll_the_languages(array(‘show_names’=>’0′,’show_flags’=>’1’))
    to show flags in my theme.

    Previously:
    All posts show lang A’s flag.
    1 post shows lang A + B flag.
    I did NOT select “Set all unmarked posts to default language” in the Settings tab

    Now:
    All posts show BOTH language’s flag, even if no translation exists…

    What changed:
    – I created menus and assigned them to Language B in the Menus tab
    – I created some terms assigned to Language B as translations of Language A
    – I clicked “set all unmarked posts to default language”

    …I *think* it’s since I clicked “set default on unmarked posts” … I haven’t done anything else with the Polylang plugin recently.

    Any idea how to get back a single flag for posts in a single language?
    I don’t mind resetting language options in my database if needed.

    Thanks!
    David

    http://wordpress.org/extend/plugins/polylang/

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

    (@chouby)

    The normal comportment of pll_the_languages is to display one flag per language existing in your site. However a flag is not displayed if no post or page has been created in that language yet.

    The current-lang-item class is here if you want not to display the flag of the current language (I know some users prefer like this).

    Thread Starter David Szego

    (@dszego)

    Thank you, that explains why the 2nd flag showed up after the first post in the 2nd language.

    What would be the best call for showing languages of *this post*, to allow flipping between languages on a per-post basis?

    Plugin Author Chouby

    (@chouby)

    Let me reformulate to check that I understood what you want.

    A flag should be displayed if a translation exists.
    No flag should be displayed if there is no translation (currently one flag is displayed and it links to the homepage to the coresponding language).
    I guess that the flag of the current language should not be displayed.

    Unfortunately, the function is not capable to do this yet. But I believe that the feature is interesting and so would add it to v0.6.

    Thread Starter David Szego

    (@dszego)

    I think you have it right but I’ll be clearer:

    On the menubar or wherever, there should be a flag for each language, allowing you to switch the entire site to the language you click on. Redirect this to the home page if selected.
    …I’m not as concerned about that, although I’d like to know which call to use to put it in my theme.

    For each article:
    I’d like a call which displays the flags of *that article’s* translations.
    So, if I put in my theme something like:

    <?php echo the_title() . ' | ' . the_translations(array('flags'=>'true','names'=>'false')); ?>

    I will get:

    An Article With English And French Translations | [BritFlag] [FranceFlag]

    or putting:

    <?php echo the_title() . ' | ' . the_translations(array('flags'=>'true','names'=>'true')); ?>

    could give me:

    An Article Only In Italian | [ItalFlag] Italian

    That would let me “flip” between translations on each article.

    Whether a flag is displayed for the current language, should be an admin option.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Polylang] All posts (even single language) now show all flags’ is closed to new replies.