Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 如何使用WP电子商务插件中添加的自定义元数据_Wordpress - Fatal编程技术网

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

Wordpress 如何使用WP电子商务插件中添加的自定义元数据,wordpress,Wordpress,我想为通过WP电子商务插件添加的每个产品显示一个唯一的标题图像 我在“高级设置”标题下添加了自定义元数据中图像的URL 我不知道如何在header.php中的WP电子商务插件的自定义元数据中添加数据 有什么建议吗 更新: 我尝试了在wpsc-single-product.php中找到的以下代码 if (wpsc_have_custom_meta()) : while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta();

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

我在“高级设置”标题下添加了自定义元数据中图像的URL

我不知道如何在header.php中的WP电子商务插件的自定义元数据中添加数据

有什么建议吗

更新:

我尝试了在wpsc-single-product.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 includes/product-template.php中,对成员函数的调用在非对象上具有_custom_meta,这取决于您将代码放置在何处。如果您没有在第29行之后输入:

while ( wpsc_have_products() ) : wpsc_the_product();

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

谢谢@annedorko,我将代码包装在产品外观中,现在可以工作了。在自定义WP_查询中使用循环时,它将变得无限,而不是一个页面