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条)

报告相同问题?