[ワードプレス] TwentyEleven テーマで カテゴリーで メインメニュー 自動 生成すること
<nav id="access" role="navigation"> <h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3> <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?> <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div> <div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div> <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> <div class="menu-category"> <ul class="menu"> <?php wp_list_categories('title_li=')?> </ul> </div> </nav>
上で8‾12番目 減らした
<div class="menu-category"> <ul class="menu"> <?php wp_list_categories('title_li=')?> </ul> </div>
これ 部分を つまんで 入れれば なる ことだ.
wp_list_categories() 関数は カテゴリー リストを 返還して 与える 関数だ. title_li という 因子値は 値段を 非運 のに, もし あのように 値段を 留守にするの なければ categories という 字が 自動で 出力される. それとともに スタイルが 割れる ことだ. 詳細な 説明はwp_list_categories() 関数 Codex(ワードプレス 公式 マニュアル) ページを 参考すれば なる.
それでは 管理者 メニューで 生成した メニューと カテゴリーを 同時に 使う 数 あるように なる. 2012-07-07 現在 内 ブログの メニューが そうに なって ある. HTML 取り離して 見れば ULこれ 二 個人 ガール 卵 数 ある ことだ.
- コメント機能はありません。コメントの代わりに[email protected]
にメールを送ってください。