Can I use my own flags for the language switcher?

Can I use my own flags for the language switcher?

Yes. You can use PNG, JPG or even SVG files and name them with the WordPress locale. For example, en_US.png.
Upload these files in the /wp-content/polylang/ directory.
Note: You have to create the directory yourself. Don』t use the /polylang/flags/ directory as your files would be removed when automatically updating the plugin. Alternatively, it』s possible to store the files in the /polylang/ subdirectory of the theme or the child theme.
Once the custom flags are uploaded, go to Languages > Settings. Click on the 「URL modifications」 settings and then on Save Changes.
Note: To specify the height and widh of SVG flags, you need to use the PHP filter pll_custom_flag.
Note: Your custom flags won』t be used on admin side. You can change them only with the PHP filter pll_flag.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註