admin管理员组文章数量:1429250
How to get nav menu list through menu name in WordPress
I'm using this code by this code but showing all pages not working with custom nav menu name
<?php wp_page_menu('sort_column=ID&sort_order=desc;'); ?>
How to get nav menu list through menu name in WordPress
I'm using this code by this code but showing all pages not working with custom nav menu name
<?php wp_page_menu('sort_column=ID&sort_order=desc;'); ?>
Share
Improve this question
edited Nov 28, 2012 at 6:27
shea
5,6624 gold badges39 silver badges62 bronze badges
asked Nov 26, 2012 at 22:54
javeednizarjaveednizar
211 silver badge2 bronze badges
0
1 Answer
Reset to default 2I think you're looking for the wp_nav_menu()
function, which deals with the navigation menus that you create in the WordPress admin (Appearance > Menus)
You can call it like this:
<?php wp_nav_menu( array( 'menu' => 'Header Menu' ) ); ?>
Where Header Menu
is the name of the menu you want to print. There are other parameters available.
本文标签: how to get nav menu list through menu name in wordpress
版权声明:本文标题:how to get nav menu list through menu name in wordpress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745528565a2661953.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论