- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
テンプレートタグ/wp nav menu
提供: WordPress Codex 日本語版
このページ「テンプレートタグ/wp nav menu」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています。
タグ一覧: テンプレートタグ | インクルードタグ | 条件分岐タグ | その他の関数 | Code Reference
使い方: テンプレートタグ入門 | パラメータの渡し方 | 初心者の方へ | その他のテーマ関連資料
Description
Display a navigation menu. Menus can be created from the backend: 外観 > 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>
Changelog
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 (最新版との差分)
関数リファレンス、テンプレートタグ目次もご覧ください。