简体   繁体   English

WordPress在菜单中添加类别

[英]WordPress add category in menu

In my website in menu bar I have 4 static menu items and one needs to be dynamic. 在我的网站菜单栏中,我有4个静态菜单项,其中一个需要是动态的。 Like 喜欢

Home | About us | contact us| Services| Product

In this menu item list. 在此菜单项列表中。 I want "product" category along with its subcategories as sub menu. 我希望“产品”类别及其子类别作为子菜单。 shown in menu. 显示在菜单中。 Like 喜欢

Product
 - sub product 1
     - sub product 1.1
 - sub product 2
 - sub product 3
     - sub product 3.1

Please suggest me how to fulfill above requirement. 请建议我如何满足上述要求。

Thank you. 谢谢。

To add menu goto admin panel. 添加菜单转到管理面板。 In left Side bat click on Appearance then on menus. 在左侧蝙蝠中单击外观然后在菜单上。 From there you can add menus and sud menus. 从那里您可以添加菜单和Sud菜单。 For submenu drag link under main menu. 对于主菜单下的子菜单拖动链接。 You can also add custom links from here. 您也可以从此处添加自定义链接。

Use wp_list_categories() to create a <ul><li> list of all your categories and style that with CSS to get a menu. 使用wp_list_categories()创建一个<ul><li>列表,列出所有类别和样式,使用CSS获取菜单。 More info on wp_list_categories() here : http://codex.wordpress.org/Template_Tags/wp_list_categories (see the list of arguments). 有关wp_list_categories()更多信息, wp_list_categories()访问: http//codex.wordpress.org/Template_Tags/wp_list_categories (参见参数列表)。

Make use of WordPress Menus, it helps you add Categories, Pages & Custom Links. 使用WordPress菜单,它可以帮助您添加类别,页面和自定义链接。 WordPress Menus can also act as a dynamic menu if you check Automatically add new top-level pages option while creating it. 如果在创建时选中自动添加新的顶级页面选项,WordPress菜单也可以充当动态菜单。

Reference: Add Multiple Menus in WordPress 参考: 在WordPress中添加多个菜单

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM