WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] Custom language Switcher - how to remove bullet (6 posts)

  1. mountain_spring
    Member
    Posted 1 year ago #

    So I made a custom images to be language switcher in a way that I put them in flags folder and renamed them in en_us.png and so.

    I've used the following code to display the image link in header

    <div id="lang"><?php pll_the_languages(array('hide_current'=>1, 'show_flags'=>1, 'show_names'=>0));?></div>

    The problem is that I don't know how to remove bullet from link. :-/

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

  2. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    This is a wrong usage of the function. You must write:

    <ul id="lang"><?php pll_the_languages(array('hide_current'=>1, 'show_flags'=>1, 'show_names'=>0));?></ul>

    Of course you can include this in a div if you want.
    Then in your css:

    #lang {list-style-type:none}
  3. mountain_spring
    Member
    Posted 1 year ago #

    Great, thanks a lot. ;)

  4. mountain_spring
    Member
    Posted 1 year ago #

    Hm, since I've renamed my english and other language flags to get something else to be images for the switcher, now I've also lost those flags in wordpress admin panel. :-/

    Is there a way to get only language switcher url?

    Something like

    <a href="CODE TO GET URL HERE"><img src="images/header_en.png"></a>

    Sorry, I'm not into php. :-/

  5. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    The best way to use custom flags is to do as described in the documentation:

    Can I use my own flags for the language switcher ?
    Yes. You have to use PNG or JPG files and name them with the WordPress locale. For example, en_US.png. Then upload these files in the /wp­content/polylang/ directory (create the directory if it does not exist). Don't use the /polylang/flags/ directory as your files would be removed when automatically updating the plugin.

    This modifies only the flags of the language switcher, not on the admin side.

  6. mountain_spring
    Member
    Posted 1 year ago #

    In the other words RTFM. :D ;)

    Great, problem solved, thanks again. ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.