我如何在wordpress 4.0上执行页面和子页面的下拉菜单,但wp_page_menu无效,wp_list_pages('title_li =')?>显示菜单但不显示子页面。请帮忙吗?
答案 0 :(得分:0)
试试这个:
ul.menu { list-style: none outside none; padding: 0; margin: 0 10px; float: left; font-size: 13px;}
ul.menu li { float: left; margin: 0; padding: 0 15px 0 0; position: relative; }
ul.menu li a { padding: 9px 5px; color: rgb(255, 255, 255); display: block; text-decoration: none; float: left; display: block;}
ul.menu li:hover { background: #A6CB1B; }
.current-cat { background: #8BBF47; }
ul.menu li span { width: 11px; height: 10px; float: left; background: url('/*url of your background or write color anme*/') -561px -78px no-repeat; margin: 11px 0 0 0;}
ul.menu li ul.children {z-index:99; list-style: none outside none; position: absolute; left: 0; top: 31px; background: none repeat scroll 0% 0% rgb(51, 51, 51); margin: 0; padding: 0; display: none; float: left; width: 170px; border-bottom: 1px solid #F8C92D;}
ul.menu li ul.children li { margin: 0; padding: 0; clear: both; width: 170px; border-top: 1px solid #F8C92D;}
html ul.menu li ul.children li a { float: left; width: 145px; background: url('images/narga-sprites.png') -578px -162px no-repeat #A6CB1B; padding-left: 20px; }
html ul.menu li ul.children li a:hover { background: url('/*url of your background or write color anme same as above*/') -578px -162px no-repeat #7BAF36; }
注意:此代码未经测试。请务必根据需要进行必要的更改。