admin管理员组文章数量:1397049
When editing Menus, I find 5 typs of items that can be added:
- Custom Links
- Pages
- Posts
- Categories
- Tags
Would it be possible to add custom ones? Let's say for instance that I want to add an image, or a search bar, or whatever.
Could I somehow add new menu items types, that render the code that I choose for them?
When editing Menus, I find 5 typs of items that can be added:
- Custom Links
- Pages
- Posts
- Categories
- Tags
Would it be possible to add custom ones? Let's say for instance that I want to add an image, or a search bar, or whatever.
Could I somehow add new menu items types, that render the code that I choose for them?
Share Improve this question asked Feb 7, 2020 at 10:48 Enrique Moreno TentEnrique Moreno Tent 2771 gold badge3 silver badges11 bronze badges2 Answers
Reset to default 0Not in the menu management interface.
You can inject custom elements if you create a custom nav walker. This requires some coding skill as well as trial and error to figure out which parts of the code you need to use, and how to tweak them.
Or, if you're comfortable using JavaScript to change things after the menu is built (so some visitors and search engines might not see the change), you could use a document.ready script that identifies a "regular" menu item and then injects whatever image etc. you want to display in its place.
You will need a plugin for that. For example, something like this one: https://wordpress/plugins/wp-megamenu/
本文标签: Custom items for Menus
版权声明:本文标题:Custom items for Menus 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744767267a2624117.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论