【发布时间】:2017-05-15 23:51:38
【问题描述】:
我将举一个例子,询问我计划做的事情是否可以使用 Wordpress,以及最终如何。
[WordPress 网站] 完全通过自定义字段数据发布的帖子
Single post structure:
- (A) Custom field artist name
- (B) Custom field artist profil pic
- (C) Custom field element description
- (D) Custom field element image
Post #1:
- Custom field artist name (John Cena)
- Custom field artist profil pic (johncena.jpg)
- Custom field element description (John Cena F-U to Hogan)
- Custom field element image (johncena_fu_hogan.jpg)
Post #2:
- Custom field artist name (John Cena)
- Custom field artist profil pic (johncena.jpg)
- Custom field element description (John Cena destroyed by Lesnar)
- Custom field element image (johncena_F5eved.jpg)
Post #3:
- Custom field artist name (John Cena)
- Custom field artist profil pic (johncena.jpg)
- Custom field element description (John Cena announces retirement)
- Custom field element image (johncena_retirement.jpg)
Post #4:
- Custom field artist name (Randy Orton)
- Custom field artist profil pic (randyorton.jpg)
- Custom field element description (Orton vs. Undertaker)
- Custom field element image (orton_vs_taker.jpg)
Post #5:
- Custom field artist name (Randy Orton)
- Custom field artist profil pic (randyorton.jpg)
- Custom field element description (Orton injured by Lesnar)
- Custom field element image (orton_injury_lesnar.jpg)
如您所见,每篇关于某位艺术家的帖子都有相同的前 2 个自定义字段,用作介绍。而剩下的 2 个总是不同的。
现在我的问题...
有没有办法自定义搜索结果页面(由自定义搜索,标签或某个类别列表调用,通常是index.php)某个艺术家的所有帖子,仅显示前2个自定义字段一次,以及所有当前帖子的剩余 2 个字段?
示例: 网址:mysite.com/tag/john-cena
Result:
- Custom field A
- Custom field B
- Custom field C
- Custom field D
- Custom field C
- Custom field D
- Custom field C
- Custom field D
这在技术上是否可以通过插入某个变量来实现,例如“如果 A 和 B = true,请勿重复”??
【问题讨论】: