• Resolved poco06

    (@poco06)


    Hello,
    I’m wondering if it’s possible to display the flags only when a traduction exists. That means for exemple, if a page has a traduction in EN and GE, both EN and GE flags will be shown on this specific page. In the contrary, if a page has only EN, the GE flag should not appear on this page.
    Thanks for your support.
    Pat

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

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

    (@chouby)

    Yes, it is possible when using the template tag pll_the_languages with the option ‘hide_if_no_translation’

    Thread Starter poco06

    (@poco06)

    Many thanks for your quick anwser Chouby,

    In which file do I have to add this template tag ?
    Pat

    Thread Starter poco06

    (@poco06)

    Hello,
    I just tried it with the PHP widget and it works partially. Here is the piece of code I have placed :

    <?php // outputs a list of languages names ?>

      <?php pll_the_languages(array(‘show_flags’=>1,‘hide_if_no_translation’=>1)); ?>

    The flags are OK now but I’m still seeing the switcher even if a page has no translation.
    Did I make a mistake in my code ?
    Regards
    Pat

    Thread Starter poco06

    (@poco06)

    OOOpppsss

    I have found the issue : I made a copy / paste directly from your doc page and the ‘ have not been taken as the right sign !!!
    Now, everything is OK
    Again, many thanks for your great plugin.
    Pat

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display flag only when traduction exists’ is closed to new replies.