WordPress 查询中的 Superfish 菜单
我在 WordPress 主题中使用 jQuery Superfish 菜单,在 sidebar.php 文件中进行了以下设置:
<div id="sidebar">
<ul id="themenu" class="sf-menu sf-vertical">
<li><a href="index.html" class="topm currentMenu nosub">Home</a></li>
<li><a href="about-us.html" class="topm nosub">About Us</a></li>
<li>
<a class="sf-with-ul topm" href="#">Instruments</a>
<ul class="bullet">
<li><a href="guitars.html">Guitars</a></li>
<li><a href="drums.html">Drums</a></li>
</ul>
</li>
</ul>
</div>
我的问题是,我可以将上面的代码转换为使用一些 wp php 函数,例如 wp_list_pages() 来用于两个顶级菜单项目以及“仪器”父菜单项下的子菜单项?
只是想知道是否有 WordPress 方法来执行 Superfish 菜单并在每个列表项旁边引入正确的 a href 值?
谢谢。
I am using jQuery Superfish Menu inside my WordPress theme, where I have the following setup inside my sidebar.php file:
<div id="sidebar">
<ul id="themenu" class="sf-menu sf-vertical">
<li><a href="index.html" class="topm currentMenu nosub">Home</a></li>
<li><a href="about-us.html" class="topm nosub">About Us</a></li>
<li>
<a class="sf-with-ul topm" href="#">Instruments</a>
<ul class="bullet">
<li><a href="guitars.html">Guitars</a></li>
<li><a href="drums.html">Drums</a></li>
</ul>
</li>
</ul>
</div>
My question is, can I transform this code above to use some wp php function such as wp_list_pages() for both top level menu items as well as the sub-menu items under the parent menu item of "Instruments" ?
Just want to know whether there is a WordPress way of doing the Superfish menu and bringing in the correct a href values alongside each list item?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有支持它的主题(看看二十十),您可以使用自定义导航功能,转到“外观>菜单”,您将能够在 WP 管理屏幕中构建自己的菜单,应该没有理由不能将 Superfish 应用于生成的菜单。
您应该了解有关 WordPress 3 中的新自定义菜单功能,然后将 Superfish 应用于该输出,在 WordPress 中对菜单进行的任何修改都将(阅读:如果设置正确,应该)立即与 Superfish 一起使用。
If you have a theme that supports it (take a look at the Twenty Ten) you can play with the custom nav feature, go to "Appearance > Menus", you'll be able to construct your own menu within the WP admin screen, there should be no reason why you cannot just apply Superfish to the generated menu.
You should learn more about the new custom menu feature in WordPress 3 and then apply Superfish to that output, any modifications to your menu from within WordPress will (read: should, if setup correctly) immediately work with Superfish.