如何添加wordpress菜單?我嘗試了一切,但似乎不太工作。原來我一直在尋找一種方式來添加dropwon菜單。例如 我使用3.6.1版如何在wordpress網站中添加菜單
Dopdown菜單
<div class="nav-wrap">
<ul class="nav">
<li class="on">
<a href='index.html' ><?php wp_nav_menu(array('container_class' => 'menu-header', 'theme_location' => 'primary')); ?></a>
</li>
<li>
<a href='#'>About us</a>
<ul class="subnav">
<li><a href='companyhistory.html'>Company History</a></li>
<li><a href='visionstatement.html'>Vision Statement </a></li>
<li><a href='missionstatement.html'>Mission Statement </a></li>
<li><a href='values.html'>Values </a></li>
<li><a href='ourpromisetoyou.html'>Our promise to you</a></li>
</ul>
</li></ul>
</div>
,但發現這不會對WordPress的工作。所以我嘗試了在菜單中建立的WordPress,但仍然無法使用。
Function.php
<?php
function twentyten_page_menu_args($args) {
$args['show_home'] = true;
return $args;
}
add_filter('wp_page_menu_args', 'twentyten_page_menu_args');
// This theme uses wp_nav_menu() in one location.
register_nav_menus(array(
'primary' => __('Primary Navigation', 'twentyten'),
));
?>
的header.php
<?php wp_nav_menu(array('container_class' => 'menu-header', 'theme_location' => 'primary')); ?><