如何使用WP电子商务插件中添加的自定义元



我想为通过WP电子商务插件添加的每个产品显示唯一的标题图像。

我在"高级设置"标题下的自定义元中添加了图像的URL。

我无法弄清楚如何在标题.php中添加WP电子商务插件的自定义元中的数据?

请提出任何建议。


更新:

我尝试按照 wpsc 单一产品中的代码进行操作.php

if (wpsc_have_custom_meta()) :
    while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta();
        $product_meta = wpsc_custom_meta_value();
    endwhile;
endif;

这会显示以下错误:致命错误:在第 1304 行的 wp-content/plugins/wp-e-commerce/wpsc-include/product-template.php 中对非对象调用成员函数 have_custom_meta)

这取决于您放置该代码的位置。如果在第 29 行之后未输入:

while ( wpsc_have_products() ) : wpsc_the_product();

。那么它不在循环中,获取自定义元数据将导致错误。

最新更新