WordPress 是否有层次结构自定义帖子类型?
我正在研究如何使用 WordPress 3.x 自定义帖子类型。我发现创建“案例”、“票据”、“图像”等内容类型是多么容易。但似乎我把所有鸡蛋都放在一个篮子里。假设我创建了一个新的自定义帖子类型“图像”,以便我可以创建画廊。有没有办法用这些图像设置多个画廊?有什么方法可以设置帖子类型“图像”的子类,以便我可以将一组图像与另一组图像区分开来并创建多个图库? 我预先感谢您的意见。
I am researching how to work with WordPress 3.x custom post types. I see how easy it is to create content types such as "case", "ticket", "image", etc, etc. But it seems like I am putting all my eggs in one basket. Lets say I create a new custom post type "image" so I can create galleries. Is there a way to setup multiple galleries with those images? Is there any way to setup sub-classes of the post type "images" so I can distinguish one group image from another and create multiple galleries?
I thank you in advance for your input.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ryy...自定义帖子类型非常灵活。您可以使用自定义分类法来区分帖子 (http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/)。无论您在 WP 上下文中的何处,您始终可以使用 WP_Query 类 (http://codex.wordpress.org/Function_Reference/WP_Query) 检索自定义帖子,该类非常灵活且易于使用。通过为您提到的事情创建自定义帖子类型,您正在做正确的事情。通过这种方式,您可以将所有事情井井有条,并且能够利用您放入其中的数据做很多事情。
ryy...custom post types are very flexible. You can distinguish posts by using custom taxonomies (http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/). Wherever you are within the WP context, you can always retrieve your custom posts using the WP_Query class (http://codex.wordpress.org/Function_Reference/WP_Query), which is extremely flexible and easy to use. You are doing the right thing by creating a custom post type for the things you've mentioned. You can keep everything well organized that way and will be able to do a lot with the data that you put into it.