简体   繁体   English

使用 ACF 将内容添加到帖子类型存档

[英]Use ACF to add content to post type archive

I'm trying to create a page with some custom fields (ACF) to display on a custom post type archive page.我正在尝试创建一个包含一些自定义字段 (ACF) 的页面,以显示在自定义帖子类型存档页面上。 I tried to create a new page with the same slug as the custom post type archive (test.com/testimonials) and display the custom fields on that page.我尝试使用与自定义帖子类型存档 (test.com/testimonials) 相同的 slug 创建一个新页面,并在该页面上显示自定义字段。

I was hoping I could show the content of the custom fields on the testimonials archive page, but it doesn't seem to work.我希望我可以在推荐档案页面上显示自定义字段的内容,但它似乎不起作用。 Can I accomplish the wanted result this way without creating a separate options page?我可以通过这种方式完成想要的结果而不创建单独的选项页面吗? This way it's easier for my client to find everything she needs.这样,我的客户就更容易找到她需要的一切。

I tried another approach.我尝试了另一种方法。 I added an options sub page to the custom post type and added the custom fields to this options page.我向自定义帖子类型添加了一个选项子页面,并将自定义字段添加到此选项页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM