如何在EDD产品标题中显示自定义字段

时间:2019-09-18 05:46:22

标签: title

我正在为我的产品使用简单的数字下载,我使用“高级”自定义字段在“ EDD产品标题”的标题中添加了自定义字段。 我已经在edd_templates-> shortcode-content-title.php中添加了代码。

<div class="product-meta">
    <?php get_template_part( 'includes/product-meta' ); ?>
<?php if ( get_field ( 'custom_product_version' ) ) : ?><span class="custom_product_version"><?php the_field ( 'custom_product_version' ); ?></span><?php endif; ?>

此CSS

    .custom_product_version {
font-size: .8rem;
line-height: 1rem;
float: right;
margin: 0 1rem 0 0;
color: #999;
}

但是使用此代码,仅在www.domain.com/products上显示自定义字段 但在首页domain..com上未在任何产品上显示自定义字段。

please screenshot
On product page showing custom field
domain.com/products

https://imgur.com/a/TlQW1Rg

domain.com
On the Home page not showing custom field.

https://imgur.com/a/zR6ueGv

问题是如何在产品标题的各处显示自定义字段。

0 个答案:

没有答案
相关问题