每个帖子有多个例外,带有摘录类别 [英] Multiple Excepts Per Post with Categories for Excerpts

查看:83
本文介绍了每个帖子有多个例外,带有摘录类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种解决方案,以允许在自定义帖子类型中每个帖子有多个摘录框,并且希望有一种方法使这些摘录具有类别。我知道我可以添加meta框以提供更多的文本区域并显示该文本,但是我不确定这就是我想要的。



为澄清起见,我有一个自定义的推荐类型。该帖子类型具有根据检查的类别显示在页面上的类别。我希望使用某些个人鉴定中的引号,因此对于同一份完整个人鉴定,我不想在同一篇文章中有多个摘录框,而对于同一份完整的个人鉴定,却没有多个引文。我希望这是有道理的,我想很难描述。谢谢。

解决方案

我认为是的,自定义元框是您所需要的。可以通过编程方式完成,但是使用优质的插件将非常快速地帮助解决此问题(以及许多其他问题)。


使用

点击放大


注意 Repeatable 选项。


在同一屏幕上,还有以下内容:



我创建了推荐具有该插件的CPT,但所有已注册的CPT(按主题或插件)应已显示在此处。


CPT页面中的结果元框



替代


高级自定义字段是另一个不错的插件,但可重复的选择是高级插件。


I am looking for a solution that would allow there to be multiple excerpt boxes per post in a custom post type, and for there to be a way to have those excerpts have categories. I know I can add meta boxes to give extra text areas and display that text, but I'm not quite sure that's what I'm looking for.

To clarify, I have a custom post type for testimonials. That post type has categories which are displayed on pages based on which category is checked. Some of the testimonials will have more than one quote in them that I want to use, so rather than have multiple posts for the the same full testimonial I want to have several excerpt boxes on the same post. I hope this makes sense, its a bit difficult to describe I guess. Thanks.

解决方案

I think yes, custom meta boxes is what you should be looking for. It can be done programmatically, but using a good plugin will help solve this issue (and many others) quite fast.

Using Custom Content Type Manager it would go like this:

Setting the Custom Field


click to enlarge

Note the Repeatable option.

In the same screen, there's also this:

I created the "Testimonials" CPT with the very plugin, but all registered CPTs (by theme or plugins) should already appear here.

Resulting Meta Box in the CPT Page

Alternative

Advanced Custom Fields is another great plugin, but the repeatable option is a premium add-on.

这篇关于每个帖子有多个例外,带有摘录类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆