本文整理汇总了PHP中wc_product_cat_class函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_product_cat_class函数的具体用法?PHP wc_product_cat_class怎么用?PHP wc_product_cat_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wc_product_cat_class函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_term_link
}
// Increase loop count
$woocommerce_loop['loop']++;
$category_link = get_term_link($category->slug, 'product_cat');
// Classes
$classes[] = 'product-category product';
$classes[] = esc_attr($width);
if (($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] == 0 || $woocommerce_loop['columns'] == 1) {
$classes[] = 'first';
}
if ($woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0) {
$classes[] = 'last';
}
?>
<div <?php
wc_product_cat_class($classes);
?>
data-width="<?php
echo esc_attr($width);
?>
">
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo esc_url($category_link);
?>
">
开发者ID:Infernosaint,项目名称:WPSetupTest2,代码行数:30,代码来源:content-product_cat.php
示例2: elseif
$col_class = 'col-md-3 col-sm-6';
} elseif ($woocommerce_loop['columns'] == 1) {
$col_class = 'col-md-12 col-sm-6';
} elseif ($woocommerce_loop['columns'] == 2) {
$col_class = 'col-md-6 col-sm-6';
} else {
$col_class = 'col-md-4 col-sm-6';
}
?>
<div class="<?php
echo esc_attr($col_class);
?>
">
<div <?php
wc_product_cat_class('item');
?>
>
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<figure class="item-thumb">
<?php
/**
* woocommerce_before_subcategory_title hook
开发者ID:sbhambad,项目名称:TimousDemo,代码行数:31,代码来源:content-product_cat.php
示例3: apply_filters
exit;
}
global $woocommerce_loop;
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count
$woocommerce_loop['loop']++;
?>
<li <?php
wc_product_cat_class();
?>
>
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<?php
/**
* woocommerce_before_subcategory_title hook
*
开发者ID:CannedHead,项目名称:feelingsurf,代码行数:31,代码来源:content-product_cat.php
示例4: define
if (!defined('SHOP_HAS_CATEGORIES')) {
define('SHOP_HAS_CATEGORIES', true);
}
# end: modified by Arlind Nushi
# start: modified by Arlind Nushi
?>
<div class="product-category-col <?php
echo $shop_columns_bs;
?>
">
<?php
# end: modified by Arlind Nushi
?>
<div <?php
wc_product_cat_class('product-category');
?>
>
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<?php
/**
* woocommerce_before_subcategory_title hook
开发者ID:adrienlementheour,项目名称:AliceRouat,代码行数:31,代码来源:content-product_cat.php
示例5: apply_filters
exit;
}
global $woocommerce_loop;
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count
$woocommerce_loop['loop']++;
?>
<li <?php
wc_product_cat_class('', $category);
?>
>
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<?php
/**
* woocommerce_before_subcategory_title hook
*
开发者ID:realbig,项目名称:TH_MONEYBALL,代码行数:31,代码来源:content-product_cat.php
示例6: apply_filters
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $woocommerce_loop;
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count
$woocommerce_loop['loop']++;
echo beans_open_markup('woo_product_category_list_item', 'li', array('class' => implode(' ', wc_product_cat_class($classes))));
do_action('woocommerce_before_subcategory', $category);
echo beans_open_markup('woo_product_category_link', 'a', array('href' => get_term_link($category->slug, 'product_cat')));
/**
* woocommerce_before_subcategory_title hook
*
* @hooked woocommerce_subcategory_thumbnail - 10
*/
do_action('woocommerce_before_subcategory_title', $category);
echo beans_open_markup('woo_product_category_title', 'h3');
echo $category->name;
if ($category->count > 0) {
echo apply_filters('woocommerce_subcategory_count_html', beans_open_markup('woo_subcategory_count_html', 'mark', array('class' => 'count')) . ' (' . $category->count . ')' . beans_close_markup('woo_subcategory_count_html', 'mark'), $category);
}
echo beans_close_markup('woo_product_category_title', 'h3');
/**
开发者ID:simondowdles,项目名称:woocommerce-overrides-for-beans,代码行数:31,代码来源:content-product_cat.php
示例7: apply_filters
exit;
}
global $woocommerce_loop;
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count
$woocommerce_loop['loop']++;
?>
<li <?php
wc_product_cat_class('col-xs-6 col-sm-6 col-md-' . 12 / $woocommerce_loop['columns']);
?>
>
<div class="product-inner">
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<?php
/**
开发者ID:GTACSolutions,项目名称:Telios,代码行数:31,代码来源:content-product_cat.php
示例8: apply_filters
// Store loop count we're currently on.
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid.
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count.
$woocommerce_loop['loop']++;
$bootstrapColumn = round(12 / $woocommerce_loop['columns']);
$classes = array();
$classes[] = sprintf('col-lg-%1$s col-md-%1$s col-sm-%2$s col-xs-6', $bootstrapColumn, 6);
?>
<li <?php
wc_product_cat_class($classes, $category);
?>
>
<div class="product-content">
<?php
/**
* woocommerce_before_subcategory hook.
*
* @hooked woocommerce_template_loop_category_link_open - 10
*/
do_action('woocommerce_before_subcategory', $category);
/**
* woocommerce_before_subcategory_title hook.
*
* @hooked woocommerce_subcategory_thumbnail - 10
*/
开发者ID:websideas,项目名称:Mondova,代码行数:31,代码来源:content-product_cat.php
示例9: esc_attr
$catimgwidth = 300;
}
}
if (!is_shop() && !is_product_category() && !is_product_tag()) {
$woocommerce_loop['columns'] = $product_cat_column;
}
$catimgheight = $catimgwidth;
?>
<div class="<?php
echo esc_attr($itemsize);
?>
kad_shop_default kad_product">
<div <?php
wc_product_cat_class('product-category postclass grid_item ', $category);
?>
>
<?php
/**
* woocommerce_before_subcategory hook.
*
* @hooked woocommerce_template_loop_category_link_open - 10
*/
do_action('woocommerce_before_subcategory', $category);
/**
* woocommerce_before_subcategory_title hook.
*
* @hooked woocommerce_subcategory_thumbnail - 10
*/
开发者ID:brianwalch,项目名称:shiftfocus,代码行数:31,代码来源:content-product_cat.php
示例10: apply_filters
exit;
}
global $woocommerce_loop;
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count
$woocommerce_loop['loop']++;
?>
<div <?php
wc_product_cat_class('col-md-3 col-sm-6 col-xs-12');
?>
>
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<?php
/**
* woocommerce_before_subcategory_title hook
*
开发者ID:rajraj,项目名称:lotus-2016,代码行数:31,代码来源:content-product_cat.php
示例11: apply_filters
exit;
}
global $woocommerce_loop;
// Store loop count we're currently on.
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid.
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count.
$woocommerce_loop['loop']++;
?>
<div <?php
wc_product_cat_class('grid__item', $category);
?>
>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<article class="card card--product card--product-cat">
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<div class="card__content">
<?php
/**
开发者ID:swaroop42,项目名称:RockRose,代码行数:31,代码来源:content-product_cat.php
示例12: apply_filters
}
global $woocommerce_loop;
// Store loop count we're currently on
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Increase loop count
$woocommerce_loop['loop']++;
?>
<li <?php
wc_product_cat_class('col-xs-4');
?>
>
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
">
<?php
/**
* woocommerce_before_subcategory_title hook
*
* @hooked woocommerce_subcategory_thumbnail - 10
开发者ID:WP-Panda,项目名称:m.video,代码行数:31,代码来源:content-product_cat.php
注:本文中的wc_product_cat_class函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论