函数wpsc_category_image()不返回任何内容 [英] Function wpsc_category_image() returns nothing
问题描述
首先,我是该论坛的新手,所以很抱歉,如果我将该主题发布到错误的位置.
我一直在尝试搜索wpsc_category_image()函数(WP电子商务wordpress插件)的用法,虽然有一些结果,但不幸的是我仍然无法达到预期的效果.
我想显示wpsc类别的所有图像,并尝试了以下代码:
First of all, I''m a newbie to this forum, so sorry if i''m posting the thread to incorrect place.
I ve been trying to search for the usage of function wpsc_category_image() (WP e-commerce wordpress plug-in), there were some results but unfortunately I still cannot achieve what I expected.
I want to show all images of wpsc categories, and tried the below codes:
<div class="wpsc_categories wpsc_category_grid group">
<?php wpsc_start_category_query(array('category_group'=> 1, 'show_thumbnails'=> 1));?>
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name();?>" style="background:url(<?php echo wpsc_category_image(); ?>)">
</a>
<?php wpsc_end_category_query(); ?>
从我从Internet上阅读的内容来看,这些代码应该可以正常工作,但是以某种方式,函数wpsc_category_image()却什么也没有返回.
你们能告诉我这个问题吗?我将不胜感激,我答应我的朋友来帮助他制作网站,但这仍然是我陷入困境的地方.
From what I have read from Internet, these codes should work fine, but somehow the function wpsc_category_image() returned nothing.
Could you guys please tell me the problem in this? I would be very appreciated, I promised my friend to help him make the website, but this is where I still got stuck
推荐答案
根据 ^ ],您作为参数传递的数组使用parent_category_id
,不category_group
.
这是他们可能要使用的示例:
According to the plugin docs[^], the array that you pass as the parameter usesparent_category_id
, notcategory_group
.
Here''s the example they use that you may want to follow:
<?php wpsc_start_category_query( array(
'parent_category_id' =>
category_id, ' show_thumbnails' =>
category_id, 'show_thumbnails' =>
show_thumbnails, ' show_name' =>
show_thumbnails, 'show_name' =>
这篇关于函数wpsc_category_image()不返回任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!