如何在 WordPress 中处理 has_many ? (唱片目录 -> 歌曲 -> 每首歌曲 5 个网址)
我正在为一个乐队编写一个 wordpress,在他们的唱片页面上他们想要以下内容:
- 专辑封面图片
- 标题
- 发行日期
- 大约 10 首歌曲的列表,他们可以点击播放...
然后每首歌曲旁边需要有 5 首不同的图标(视频、歌词、播放、亚马逊链接、itunes 链接)。
起初我打算使用自定义帖子类型,但考虑到这只是一维数据,我不知道该怎么做,因为他们必须为每个专辑添加 10 首歌曲,然后是与每首歌曲关联的 5 个网址。
我如何使用自定义帖子类型来做到这一点?或者有一个插件可以提供帮助吗?
I'm coding a wordpress for a band and on their discography page they want the following:
- Album cover image
- Title
- Release date
- List of 10 or so songs that they can click to play...
Then next to EACH song needs to be 5 different icons (video, lyrics, play, amazon link, itunes link).
At first I was going to use a custom post type, but considering that's only 1 dimension of data i dont know what to do, as they have to add like 10 songs for each album, and then the 5 urls associated with each song.
How might i do this with custom post types? or is there a plugin that could help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于类似的内容,请查看自定义字段 (http://codex.wordpress.org/Custom_Fields)。
这个插件会有所帮助
http://wordpress.org/extend/plugins/custom-field-template/
虽然可以(但需要解释很多)自己编写代码。上述插件将为您做很多事情。
For something like that, look into Custom Fields (http://codex.wordpress.org/Custom_Fields).
This plugin would help
http://wordpress.org/extend/plugins/custom-field-template/
Though it is possible (but a lot to explain) to code them yourself. The aforementioned plugin will do a lot of that for you.