Title: WPML flag in menu Extended
Author: johanvandemerwe
Published: <strong>2013 年 2 月 26 日</strong>
Last modified: 2016 年 4 月 7 日

---

搜索插件

![](https://ps.w.org/wpml-flag-in-menu-extended/assets/banner-772x250.png?rev=1389472)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/wpml-flag-in-menu-extended.svg)

# WPML flag in menu Extended

 作者：[johanvandemerwe](https://profiles.wordpress.org/jvandemerwe/)

[下载](https://downloads.wordpress.org/plugin/wpml-flag-in-menu-extended.1.7.zip)

 * [详情](https://cn.wordpress.org/plugins/wpml-flag-in-menu-extended/#description)
 * [评价](https://cn.wordpress.org/plugins/wpml-flag-in-menu-extended/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wpml-flag-in-menu-extended/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wpml-flag-in-menu-extended/#developers)

 [支持](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/)

## 描述

Shows translated flags (for every language except current viewing lang) in any selected
menu in the plugin settings
 LTR support

In addition to the plugin from Ramon Fincken, this plugin let you select on which
menu you want to add the language flags.
 You can even make an empty menu and make
it dedicated for your language flags and put it as a custom menu in the sidebar.

To make the flags appear on a translated menu, you go in the settings of the plugin
and add the translated menu to the selection
 you made. This has to be done with
every translated menu where you want the flags to appear. So, if you just have translated
a menu. Go back to the options of the widget and you will see that this translated
menu is added to the list. Select this menu too and save the options.

See other notes tab for explanation

Visit: http://www.enovision.net/wpml_flag_in_menu_extended/ for more explanation.

### additional classes

You can also add an additional class for the IMG and LI tag. On the LI tag is automatically
added the class “not-last” for all
 flag items but the last one, and “last” for 
the last flag.

Now you can add some styling like:

    ```
    /* make a border around the flag icon */
    img.wpml_flags {
        border : 1px solid #f1f1f1;
    }

    /* bring the icons a bit closer together */
    li.wpml_flags.not-last {
        margin-right : -20px;
    }

    /* a little left padding after the flag, when name is used too */
    .wpml_flags_name {
        padding-left : 10px;
    }
    ```

You can find these styles in the style.css in the css directory of the plugin.
 
Modify this to your own requirements.

### How to right justify the menu’s on a menu?

You can add a wrapper class around the flags and put some CSS styles on it.

In the wrap element you put: div
 In the wrap extra classes you put: flag_wrapper.

    ```
     #main-nav ul div.flag_wrapper {
        float: right;
    }
    ```

In the wrap element you put: span
 In the wrap extra classes you put: flag_wrapper.

    ```
     #main-nav ul span.flag_wrapper {
        float: right;
        line-height: 14px; /* this could be different */
    }
    ```

### How to add a menu to a seperate widget area?

 1. Create a new menu f.e. “Language Selecter”
 2. Add a custom link to this menu with in the label: [wpml_flag_menu]
 3. Save the menu
 4. Create/Translate the menu in all your languages (to make it exists in all languages)
 5. Modify the wmpl_flag_menu settings and select the menus used created/translated
 6. Save the settings
 7. Add a custom menu widget to the sidebar or any other widget area and select the“
    Language Selecter” as selected menu
 8. Save the settings and look for the result

### Limitations

This plugin will not create flags on the main navigation menu of SOME(!) Genesis
Framework (child) Themes !!!

Coding by: Johan van de Merwe

## 屏幕截图

[⌊Sample of a horizontal menu with flags⌉⌊Sample of a horizontal menu with flags⌉[

Sample of a horizontal menu with flags

[⌊Sample of a vertical menu with flags in sidebar⌉⌊Sample of a vertical menu with
flags in sidebar⌉[

Sample of a vertical menu with flags in sidebar

[⌊Settings panel (general settings)⌉⌊Settings panel (general settings)⌉[

Settings panel (general settings)

[⌊Settings panel (styling)⌉⌊Settings panel (styling)⌉[

Settings panel (styling)

[⌊Custom menu installation⌉⌊Custom menu installation⌉[

Custom menu installation

[⌊Right adjusted menu⌉⌊Right adjusted menu⌉[

Right adjusted menu

## 安装

 1. Upload directory `wpml-flag-in-menu-extended` to the `/wp-content/plugins/` directory
 2. 通过WordPress的“插件”菜单激活插件。
 3. Select menu’s where you want the flags to appear in the Settings/WPML Flags in 
    Menu Extended Dashboard option
 4. You are done!

## 常见问题

Visit http://www.enovision.net/contact/ and drop your question.

## 评价

![](https://secure.gravatar.com/avatar/87758431cc8afd1a22e86d13504b03fe6b742486c62449175b8d30483ed245f9?
s=60&d=retro&r=g)

### 󠀁[Works like a charm !](https://wordpress.org/support/topic/works-like-a-charm-1235/)󠁿

 [deanMKD](https://profiles.wordpress.org/deanmkd/) 2018 年 4 月 8 日

Working on Wordpress 4.9.5 as expected !

![](https://secure.gravatar.com/avatar/2dd5044987dfc99fa684d7c9a4f9c38c23bcde198c871fc38a986e361be10f11?
s=60&d=retro&r=g)

### 󠀁[Fast and Easy!](https://wordpress.org/support/topic/fast-and-easy-59/)󠁿

 [amikeliunas](https://profiles.wordpress.org/amikeliunas/) 2017 年 3 月 12 日

Much better than the WPML options themselves so you can hide the flaf of the current
language. Fast and Easy!

![](https://secure.gravatar.com/avatar/0f44c6739bdbb9bfb2e6c11c16b27670998f0904ce81092c2bf5bc2ee820a3d3?
s=60&d=retro&r=g)

### 󠀁[Very useful, better than WPML original feature](https://wordpress.org/support/topic/very-useful-better-than-wpml-original-feature/)󠁿

 [activatonline](https://profiles.wordpress.org/activatonline/) 2016 年 9 月 3 日

Simple and good working plugin , more helpful than the WPML include selector on 
menu options.

![](https://secure.gravatar.com/avatar/5d89f6f647742d6547520bd5dec709a1d5d8905c90d01fc1e24001d9eaf74a2e?
s=60&d=retro&r=g)

### 󠀁[Great service, plugin does was it is supposed to do](https://wordpress.org/support/topic/great-service-plugin-does-was-it-is-supposed-to-do/)󠁿

 [casacalenc](https://profiles.wordpress.org/casacalenc/) 2016 年 9 月 3 日

Service desk, Johan, responded immediately, after a small issue with WPML.

 [ 阅读所有9条评价 ](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/)

## 贡献者及开发者

「WPML flag in menu Extended」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ johanvandemerwe ](https://profiles.wordpress.org/jvandemerwe/)

[帮助将「WPML flag in menu Extended」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wpml-flag-in-menu-extended)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wpml-flag-in-menu-extended/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/wpml-flag-in-menu-extended/)，或
通过[RSS](https://plugins.trac.wordpress.org/log/wpml-flag-in-menu-extended/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wpml-flag-in-menu-extended/)。

## 更新日志

#### 1.7

 * Added the possibility to have wrapper classes around the flag’s li elements

#### 1.6

 * Added setting that makes it possible to show also the flag of the active langauge

#### 1.5

 * Solved the issue that the plugin broke down due to using the same class name 
   as in the WPML plugin.
 * Split the settings in “General Settings” and “Styling”
 * Some code optimisation
 * Tested with version 3.3.1 of WPML (thanks to Han Six D. at montemeleto.com)

#### 1.4

 * Solved a bug that in some cases no flags would show in case the menu item that
   was send in the arguments of the main function was a string instead of an object

#### 1.3

 * Updated the menu link in the admin menu, it didn’t show up when WP Better Security
   plugin is installed
 * Corrected the hover on the last menu flag, sometimes it didn’t add the “last”
   CSS class
 * Added height and width for the flag image to the settings of this plugin (default
   = 16×16)

#### 1.2

 * Added menu in seperate widget area
 * Added language name added to the icon
 * Additional settings in the admin panel

#### 1.1

 * Minor update

#### 1.0

 * First release

## 额外信息

 *  版本 **1.7**
 *  最后更新：**11 年前**
 *  活跃安装数量 **200+**
 *  WordPress 版本 ** 2.0.2 或更高版本 **
 *  已测试的最高版本为 **4.3.34**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wpml-flag-in-menu-extended/)
 * 标签
 * [header](https://cn.wordpress.org/plugins/tags/header/)[menu](https://cn.wordpress.org/plugins/tags/menu/)
   [nav](https://cn.wordpress.org/plugins/tags/nav/)[wpnav](https://cn.wordpress.org/plugins/tags/wpnav/)
   [wp_nav_menu](https://cn.wordpress.org/plugins/tags/wp_nav_menu/)
 *  [高级视图](https://cn.wordpress.org/plugins/wpml-flag-in-menu-extended/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  9 条 5 星评价     ](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/?filter=1)

[您的评价](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/reviews/)

## 贡献者

 *   [ johanvandemerwe ](https://profiles.wordpress.org/jvandemerwe/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wpml-flag-in-menu-extended/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=XJNWD3EWE44GE&lc=NL&item_name=WPML%20Flags%20in%20Menu%20WP%20Plugin&item_number=WPML_Flags&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)