前言介紹
- 這款 WordPress 外掛「WPML flag in menu Extended」是 2013-02-25 上架。
- 目前有 300 個安裝啟用數。
- 上一次更新是 2016-04-07,距離現在已有 3313 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.0.2 以上版本才可以安裝。
- 有 9 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
nav | menu | wpnav | header | wp_nav_menu |
內容簡介
在外掛設定中選取任何菜單,顯示翻譯後的國旗(除了當前觀看語言)
LTR 支援
此外,與 Ramon Fincken 的外掛相比,此外掛讓您選擇要添加語言國旗的菜單。
您甚至可以創建一個空的菜單,將其專門用於您的語言國旗,並將其作為自定義菜單添加到側邊欄。
要在翻譯的菜單上顯示國旗,請在插件的設定中添加翻譯菜單到您之前選擇的選擇中。
如果您只是翻譯了一個菜單,請返回小工具的選項,您會看到此翻譯菜單已添加到列表中。也選擇此菜單並
保存選項。
有關解釋,請參閱其他說明選項卡
訪問:http://www.enovision.net/wpml_flag_in_menu_extended/ 進一步了解。
其他類別
您還可以為 IMG 和 LI 標籤添加其他類別。 在 LI 標籤上,對於所有的旗幟項目,自動添加類別“not-last”,但
最後一個標誌添加“last”類別。
現在您可以添加一些樣式,例如:
/* 聲明旗幟圖標的邊框 */
img.wpml_flags {
border : 1px solid #f1f1f1;
}
/* 將圖標選項拉近一些 */
li.wpml_flags.not-last {
margin-right : -20px;
}
/* 國家名稱顯示后,添加一些左邊縮進 */
.wpml_flags_name {
padding-left : 10px;
}
您可以在插件中的 css 目錄中的 style.css 中找到這些樣式。
根據您的需求進行修改。
如何在菜單上右對齊菜單?
您可以在旗幟周圍添加一個包裝類,然後對其進行一些 CSS 樣式處理。
在包裝元素裡添加:div
在包裝時額外添加類別:flag_wrapper。
#main-nav ul div.flag_wrapper {
float: right;
}
在包裝元素裡添加:span
在包裝時額外添加類別:flag_wrapper。
#main-nav ul span.flag_wrapper {
float: right;
line-height: 14px; /* 可能不同 */
}
如何將菜單添加到單獨的小工具區域?
創建一個新的菜單,例如"語言選擇器"
添加一個自定義鏈接到此菜單並將"wpml_flag_menu"添加到標籤
保存菜單
在所有語言中創建/翻譯菜單(以便在所有語言中都存在)
修改 wmpl_flag_menu 設置並選擇創建/翻譯的菜單
保存設置
將自定義菜單小工具添加到側邊欄或其他小工具區域,並選擇"語言選擇器"菜單
保存設置並查看結果
限制
此外掛不會在 SOME(!) Genesis Framework (child) Themes 的主導航菜單中創建國旗!
編碼:Johan van de Merwe
原文外掛簡介
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?
Create a new menu f.e. “Language Selecter”
Add a custom link to this menu with in the label: [wpml_flag_menu]
Save the menu
Create/Translate the menu in all your languages (to make it exists in all languages)
Modify the wmpl_flag_menu settings and select the menus used created/translated
Save the settings
Add a custom menu widget to the sidebar or any other widget area and select the “Language Selecter” as selected menu
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
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WPML flag in menu Extended」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | trunk |
延伸相關外掛(你可能也想知道)
Add menu separators to navigation 》讓 WordPress 經典導覽選單支援分隔線(HR / 水平線)和未連結的純文字項目。, 區塊編輯器, 本外掛不支援區塊編輯器或導覽區塊。它適用於使用 WordPress 經典...。
Disable Parent Menu Link 》預設情況下,WordPress wp_nav_menu 函數會在父層和子層菜單上產生鏈接。如果您只想讓子層鏈接是可點擊的,那麼此外掛可以解決您的問題。, 我們非常樂意聆聽...。
WPML flag in menu 》此外掛在預設或wp_nav_menu中的最後一個位置顯示被翻譯的旗幟(除了當前語言外的每種語言)。, wp_nav_menu = 外觀 -> 選單, 支援LTR, 編碼者: MijnPress...。
Sweet Custom Menu 》這是一個簡單的外掛程式,可在 WordPress 菜單中添加自定義屬性。這個外掛程式可以正常運作,但應該被用作實現自定義菜單欄位的範例。這個外掛程式的創建過程...。
MAJpage Menu Class Extender 》此簡單的外掛程式是為了在舊版瀏覽器中支援辨識 wp_page_menu 和 wp_nav_menu 的「第一個元素」、「最後一個元素」、「父層元素」、「偶數項目」和「奇數項目...。
Gambit Cache Menus 》Gambit Cache Menus 可以快取您在前端使用的選單。儘管每個選單只能少了約 18 毫秒的載入時間,但如果您的網站有著大型多層級選單以及大量瀏覽者,那麼速度優...。