- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
テンプレートタグ/wp nav menu
提供: WordPress Codex 日本語版
< テンプレートタグ
2010年3月20日 (土) 21:42時点におけるBono (トーク | 投稿記録)による版 (en:Function Reference/wp_nav_menu 12:38, 20 March 2010 Bono 版を翻訳用にコピー/ author: Benoit G)
Description
Display a navigation menu. Menus can be created from the backend: Appearance > Menus.
Usage
%%% <?php wp_nav_menu($args); ?> %%%
Parameters
- $id
- (integer) (optional) The menu id.
- 初期値: blank
- $slug
- (string) (optional) The menu slug
- 初期値: blank
- $menu
- (string) (optional) The menu name
- 初期値: blank
- $container
- (string) (optional) Parent element of the menu
- 初期値: div
- $container_class
- (string) (optional) The parent element class
- 初期値: blank
- $menu_class
- (string) (optional) The menu class
- 初期値: div
- $format
- (string) (optional) Whether to format the ul
- 初期値: menu
- $fallback_cb
- (string) (optional) If the menu doesn't exists, a callback function will fire
- 初期値: wp_page_menu
- $before_link
- (string) (optional) Output text before the link
- 初期値: なし
- $after_link
- (string) (optional) Output text after the link
- 初期値: なし
- $before_title
- (string) (optional) Output text before the link text
- 初期値: なし
- $after_title
- (string) (optional) Output text after the link text
- 初期値: なし
- $echo
- (boolean) (optional) Whether to echo the menu or return it
- 初期値: true
Examples
<div class="access"> <?php wp_nav_menu(); ?> </div>
Change log
Since 3.0
Source file
wp_nav_menu() is located in wp-includes/nav-menu-template.php
.
Related
最新英語版: WordPress Codex » Function Reference/wp nav menu (最新版との差分)
関数リファレンス、テンプレートタグ目次もご覧ください。