WordPress
0
Вклад в тег
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
global $product, $woocommerce_loop;
// Ensure visibility
if ( empty( $product ) || ! $product->is_visible() ) {
return;
}
// Store column count for displaying the grid
if ( empty( $woocommerce_loop['columns'] ) ) {
$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 3 );
}
// Extra post classes
$classes = array();
if ($woocommerce_loop['columns'] == 2) {
$classes[] = 'col-md-6';
}elseif($woocommerce_loop['columns'] == 4){
$classes[] = 'col-md-3';
}elseif($woocommerce_loop['columns'] == 6){
$classes[] = 'col-md-2';
}else{
$classes[] = 'col-md-4';
}
?>
<div <?php post_class( $classes ); ?>>
<div class="product-item">
<?php
/**
* woocommerce_before_shop_loop_item hook.
*
* @hooked woocommerce_template_loop_product_link_open - 10
*/
do_action( 'woocommerce_before_shop_loop_item' );
?>
<b><a href="<?php the_permalink(); ?>" class="products-warp"></b>
<?php
/**
* woocommerce_before_shop_loop_item_title hook.
*
* @hooked woocommerce_template_loop_product_thumbnail - 10
* @hooked woocommerce_show_product_loop_sale_flash - 10
*/
do_action( 'woocommerce_before_shop_loop_item_title' );
?>
<b></a></b>
<div class="product-info">
<b><a href="<?php the_permalink(); ?>"></b>
<?php
/**
* woocommerce_shop_loop_item_title hook.
*
* @hooked woocommerce_template_loop_product_title - 10
*/
do_action( 'woocommerce_shop_loop_item_title' );
?>
<b></a></b>
<?php
/**
* woocommerce_after_shop_loop_item_title hook.
*
* @hooked woocommerce_template_loop_rating - 5
* @hooked woocommerce_template_loop_price - 10
*/
<b>do_action( 'woocommerce_after_shop_loop_item_title' );</b>
/**
* woocommerce_after_shop_loop_item hook.
*
* @hooked woocommerce_template_loop_product_link_close - 5
* @hooked woocommerce_template_loop_add_to_cart - 10
*/
<b>do_action( 'woocommerce_after_shop_loop_item' );</b>
?>
</div>
</div>
</div>
<a href="http://www.ararredamenti.it/" rel="noopener" target="_blank">www.ararredamenti.it</a>
(Excel в помощь). Соответственно теперь нужно добавить хук, который выводил бы нам short description./**
* Ссылки на фабрики в /shop.
*/
add_action( 'woocommerce_brands_link', 'woocommerce_template_single_excerpt', 10 );
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
global $product, $woocommerce_loop;
// Ensure visibility
if ( empty( $product ) || ! $product->is_visible() ) {
return;
}
// Store column count for displaying the grid
if ( empty( $woocommerce_loop['columns'] ) ) {
$woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 3 );
}
// Extra post classes
$classes = array();
if ($woocommerce_loop['columns'] == 2) {
$classes[] = 'col-md-6';
}elseif($woocommerce_loop['columns'] == 4){
$classes[] = 'col-md-3';
}elseif($woocommerce_loop['columns'] == 6){
$classes[] = 'col-md-2';
}else{
$classes[] = 'col-md-4';
}
?>
<div <?php post_class( $classes ); ?>>
<div class="product-item">
<?php
/**
* woocommerce_before_shop_loop_item hook.
*
* @hooked woocommerce_template_loop_product_link_open - 10
*/
do_action( 'woocommerce_before_shop_loop_item' );
?>
<?php
/**
* woocommerce_before_shop_loop_item_title hook.
*
* @hooked woocommerce_template_loop_product_thumbnail - 10
* @hooked woocommerce_show_product_loop_sale_flash - 10
*/
do_action( 'woocommerce_before_shop_loop_item_title' );
?>
<div class="product-info">
<?php
/**
* woocommerce_shop_loop_item_title hook.
*
* @hooked woocommerce_template_loop_product_title - 10
*/
do_action( 'woocommerce_shop_loop_item_title' );
do_action( 'woocommerce_brands_link' );
?>
<?php
?>
</div>
</div>
</div>