當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wc_product_cat_class函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。