wordpress产品分类名称显示

wordpress产品分类名称显示

用过wordpress的都应该知道wp-e-commerce这个插件,如果不知道的,现在就知道了.这是一个wordpress管理产品的插件,安装之后会有电子商务的功能,包括编辑产品分类,产品的添加包括(产品名称,图片,图片尺寸,描述,价格等等).当然也有很多的功能要设置.这里就讲用分类名称显示和分面显示.

  1. 进入wordpress后台,添加好产品分类和相对相的产品之后,点击”设置->store” 在右边选择” Presentation”如下图:
  1. 下拉右边栏目,找到Show list of categories将其设置为 yes.
  2. 找到Show Breadcrumbs:设置为yes .这个设置好以后如果你在产品分类栏添加分类图片时,前台的分类名称和图片会一起显示.如果你只想显示图片或分类,小弟改了一下程序,功能是在有分类图片时显示分类图片,没有分类图片时显示分类名称.找到文件wp-e-commercewpsc-includescategory.functions.php中的函数function wpsc_display_category_loop 拉到函数末将

$tags_to_replace = array(‘[wpsc_category_name]’,

‘[wpsc_category_description]’,

‘[wpsc_category_url]’,

‘[wpsc_category_id]’,

‘[wpsc_category_classes]’,

‘[wpsc_category_image]’,

‘[wpsc_subcategory]’,

‘[wpsc_category_products_count]’);

$content_to_place = array(

esc_html($category_row->name),

$category_description,

get_term_link($category_row->slug, ‘wpsc_product_category’),

$category_row->term_id,

$category_classes,

$category_image_html,

$sub_categories,

$category_count_html);

改成:

$tags_to_replace = array(‘[wpsc_category_name]’,

‘[wpsc_category_description]’,

‘[wpsc_category_url]’,

‘[wpsc_category_id]’,

‘[wpsc_category_classes]’,

‘[wpsc_category_image]’,

‘[wpsc_subcategory]’,

‘[wpsc_category_products_count]’);

if($category_image_html!=””)

{

$category_row->name=””;

}

$content_to_place = array(

esc_html($category_row->name),

$category_description,

get_term_link($category_row->slug, ‘wpsc_product_category’),

$category_row->term_id,

$category_classes,

$category_image_html,

$sub_categories,

$category_count_html);保存即可.还可以将分类的位置进行更改. 分类显示的代码在wp-e-commercewpsc-themewpsc-products_page.php 代码如下:

<?php if(wpsc_display_categories()): ?>

<?php if(wpsc_category_grid_view()) :?>

<?php wpsc_start_category_query(array(‘category_group’=> get_option(‘wpsc_default_category’), ‘show_thumbnails’=> 1)); ?>

<?php wpsc_print_category_image(get_option(‘186′),get_option(’47’)); ?>

<?php wpsc_print_subcategory(“”, “”); ?>

<?php wpsc_end_category_query(); ?>

<?php else:?>

<?php #echo $_SESSION[“a”];?>

<?php wpsc_start_category_query(array(‘category_group’=>get_option(‘wpsc_default_category’), ‘show_thumbnails’=> get_option(‘show_category_thumbnails’))); ?>

    • <?php echo $_SESSION[“ddd”];?><?php wpsc_print_category_image(get_option(‘186′), get_option(’47’)); ?>

      <?php wpsc_print_category_name(); ?>

      <?php if(wpsc_show_category_description()) :?>

      <?php endif;?>

<?php  wpsc_end_category_query();?>

<?php endif; ?>

<?php endif; ?>

<?php // */ ?>

Facebooktwittergoogle_pluslinkedinmail

Need a translation service?

Please enter your personal details and we will contact you shortly

Words translated by CCJK

146,096,379

Our Client Satisfaction

Rating for previous quarterr

4.00

Over 95% of our clients recommend our language services to others

Copyright © CCJK Technologies Co., Ltd. 2000-2017. All rights reserved.
TOP