• Resolved LBA1403

    (@lba1403)


    Hi

    I’m trying to use the plugin without the widget. I’m trying to only show flags as the switcher, without language-names. I’ve added this php to my page

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

    Everything works perfectly fine (if I set show_names to 1 I can see it working) but the flags simply does not show up. I’ve tried to upload custom flags as well, using the lang-code as filename to wp-content/polylang, but that didn’t work either.

    I suppose I’ve done some stupid mistake that I just doesn’t see myself.
    Any help is greatly appreciated!

    https://ww.wp.xz.cn/plugins/polylang/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Chrystl

    (@chrystl)

    Hi

    Did you re-saves you Polylang settings? Go in Settings > Languages > Settings tab and click on “Save changes”.

    Does it work?

    Thread Starter LBA1403

    (@lba1403)

    Hi Chrystl

    Nope, it still doesn’t work.

    Plugin Support Chrystl

    (@chrystl)

    using the lang-code as filename

    Did you rename them according to the WordPress Locale.

    In the Languages tab, the “Locale” field must have the right WordPress Locale as your custom flags.

    Thread Starter LBA1403

    (@lba1403)

    Yeah, I have done that as well. I want to have flags for English and Norwegian, and I’ve saved the files as “en_US.png” and “nb.png” in the wp-content/polylang directory and uploaded them (I can see them in my browser when I enter the directory)

    In the “locale” field it’s correct for the US one, but it wont save it for the norwegian.

    Plugin Support Chrystl

    (@chrystl)

    When you edit your language you should have for the english the “Locale” field : en_US. And your custom flags name as en_US.png

    For Norwegian you should have for “Locale” field: nb_NO with your custom flags name as nb_NO.png

    After each changes of these datas you must resave your changes in Languages > Settings tab.

    To be sure that it is not a problem with your custom flags could you try to set up another flags provide by http://www.famfamfam.com/lab/icons/flags/

    Does it work?

    Plugin Support Chrystl

    (@chrystl)

    I tested your code and my custom flags are displayed.

    Did you solve your issue?

    Thread Starter LBA1403

    (@lba1403)

    After I tried the new flags it worked for the English, so I’m halfway!

    When I try to change the “Locale” for Norwegian and I hit “update” it won’t save my change! Any idea why it’s like this?

    Plugin Support Chrystl

    (@chrystl)

    Which language did you choose in the dropdown “Choose a language” (1)?
    Norsk Bokmål? This language have already the right locale code (3).

    Or did you create your own language by filling the field “Full name”(2)?

    See (1)(2)(3)Getting started.

    If you do the things correctly, it’s maybe a conflict. Please deactivate all your plugins except Polylang. Then Edit your language, change the locale and update it.

    After that reativacte your other plugins.

    Thread Starter LBA1403

    (@lba1403)

    I can’t really understand how I’ve done it, but it seems the first time I managed to remove the Locale-code when I added Norwegian. However, I fixed it by simply deleting Norwegian from the list and then adding it again.

    Now it works perfectly, thank you very much for your time and your suggestions Chrystl!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Flags doesn't show, non-widget’ is closed to new replies.