WordPress 多层菜单

下了个主题,发现只支持一级菜单……
去网上,先找了一个Multi-level Navigation插件,但是主题不配合……
继续找,找到那么一篇文章:
WordPress Multi-Level Drop Down menu using jQuery | SEOAdsenseThemes.com
弄到WP里面去,竟然就好了……
其实就是加:

<script type=‘text/javascript’>

      jQuery(document).ready(function(){
          jQuery("#dropmenu ul").css({display:"none"});// Opera Fix
          jQuery("#dropmenu li").hover(
              function(){ 
                     jQuery(this).find('ul:first').css({visibility:"visible",display:"none"}).show(268); 
 }   ,function(){ 
                     jQuery(this).find('ul:first').css({visibility:"hidden"}); 
 }
          ); });

</script>

<style type=“text/css”>

      #dropmenu, #dropmenu ul {list-style-type:none; list-style-position:outside; position:relative;z-index:300; width:100%;}

</style>

到HTML页面的head部分里面,然后把原来的

<?phpwp_list_pages(title_li=&depth=10); ?>

换成

<ulid=“dropmenu”><?phpwp_list_pages(sort_column=menu_order&title_li=); ?></ul>

就行了……

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.