简体   繁体   English

wordpress-添加新的基于类别的管理面板菜单标签

[英]wordpress - add new category based admin panel menu tab

i want to show a new admin menu tab which will pull information from a certain category, ie products. 我想显示一个新的管理菜单选项卡,它将从某个类别(即产品)中提取信息。

I do not want to use custom Post types because i want to be able to change themes with out any modification to theme files, so please do not recommend that. 我不想使用自定义帖子类型,因为我希望能够在不对主题文件进行任何修改的情况下更改主题,所以请不要这样做。

using wordpress function add_menu_page() i can add a new tab, but how to show new post page and existing posts of that category, exactly like custom post type. 使用wordpress函数add_menu_page()我可以添加一个新选项卡,但是如何显示新的帖子页面和该类别的现有帖子,就像自定义帖子类型一样。

thanks 谢谢

You should try to create your custom post types as part of a plugin anyway, as that's what WordPress recommends: 无论如何,您都应该尝试将自定义帖子类型创建为插件的一部分,因为这是WordPress的建议:

https://codex.wordpress.org/Post_Types#A_word_about_custom_post_types_as_a_plugin https://codex.wordpress.org/Post_Types#A_word_about_custom_post_types_as_a_plugin

That way you can them with any theme. 这样,您就可以将它们与任何主题结合使用。

Did you try the Menus? 您尝试过菜单吗?

If I'm not mistaken, what you want to do is to create a menu tab that can fetch the posts from a certain category 如果我没记错的话,您要做的是创建一个菜单选项卡,该选项卡可以从特定类别中获取帖子

Create a post with your category 用您的类别创建帖子

In your dashboard go to the Appearance > Menus Name your Menu, after creating your New Menu You can select what you want to add on that Menu by checking it and clicking Add Menu, the Categories are on the bottom part. 在仪表盘中,转到“外观”>“菜单”,为您的菜单命名,创建新菜单后,您可以通过选中菜单并单击“添加菜单”来选择要添加的菜单,“类别”位于底部。

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

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