doulao1934 2016-04-29 09:41
浏览 113
已采纳

修改显示哪些Wordpress类别

I'm building a bespoke Wordpress theme for a periodical. I have a category set up that basically marks an article as "featured," making them appear on the homepage. I'd like for this category to not appear when browsing the site, however, as it's meant for the magazine's staff to be able to control what's on the homepage, rather than be used as a tool for user's to search with.

Since the_category(); will return all categories, I need help building a php loop that will display categories while skipping this one. A post will only ever have one category, unless this second one is applied. I also think building a function that could be referenced several times across the site would be the most efficient way of handling this.

If there's an even simpler method to reach the same outcome, feel free to point that out as well. I'd just like to keep my plugin dependencies minimal. Thanks for your assistance!

  • 写回答

2条回答 默认 最新

  • 普通网友 2016-05-01 05:50
    关注

    After doing more research into my options for developing with Wordpress, I've found that using a custom post type will work far better than filing these posts under a category. Apologies for the confusing post.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 手机连接电脑热点显示无ip分配
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大