如何在 Wordpress.org 2.8.4 中对静态页面中的子页面进行排序?
我已经为页面的顶级导航应用了自定义顺序,但它不会自动按字母顺序对子菜单进行排序,尽管我假设了这种行为:
Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)
我使用这行代码实现了导航:
<?php wp_page_menu( 'sort_column=menu_order' ); ?>
最后,我真的必须去并且手动排序我的静态页面,或者我应该手动编程菜单项的顺序?
I already applied a custom order for the toplevel navigation of my page, but it doesn't automatically sort the submenus alphabetically, although i assumed this behavior:
Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)
I implemented the navigation using this line of code:
<?php wp_page_menu( 'sort_column=menu_order' ); ?>
Finally, do I really have to go and manually order my static pages, or should i manually program the order of the menu items?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为我的页面订单扩展可能就是您正在寻找的。
I think that the My Page Order extension might be what you are looking for.
另外,您是否尝试过:
而不是“menu_order”?
根据 Codex,看起来标题会导致按字母顺序排序?
http://codex.wordpress.org/Template_Tags/wp_page_menu
Also, have you tried:
instead of 'menu_order'?
Per the Codex, it looks like the title would result in alphabetical sorting?
http://codex.wordpress.org/Template_Tags/wp_page_menu