当类别已应用产品时,WordPress产品类别的高级自定义字段消失了

发布于 2025-01-24 19:27:40 字数 353 浏览 5 评论 0原文

我可以成功地将我的高级自定义字段显示在没有应用产品的类别页面上。但是,一旦我将产品应用于类别,则自定义字段停止在前端显示。 有什么想法我如何保留自定义字段显示并在类别页面上显示产品列表? 示例页: 类别示例示例url

当不应用产品时可行的示例代码:

<?php the_field(‘categtest1’); ?>
<?php the_field(‘richt’); ?>  

I can successfully get my Advanced Custom Fields to display on Category pages that don’t have Products applied to them. But as soon as I apply products to the category, then the Custom Fields stop displaying on the frontend.
Any ideas how I can retain the Custom Fields display and also show product listings on the Category pages?
Example page:
Category example URL

Example code that works when no products are applied:

<?php the_field(‘categtest1’); ?>
<?php the_field(‘richt’); ?>  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文