// Добавить класс к обертке с товарами
add_filter('woocommerce_product_loop_start', 'mytheme_product_loop_start');
function mytheme_product_loop_start() {
?>
<ul class="card-group products columns-<?php echo esc_attr( wc_get_loop_prop( 'columns' ) ); ?>">
<?php
}
// Вывод категории в карточках товара
add_action( 'woocommerce_before_shop_loop_item_title', 'storm_show_product_cat', 30 );
function storm_show_product_cat() {
global $product;
echo wc_get_product_category_list( $product->get_id(), ', ', '<div class="product-cat">' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'woocommerce' ) . ' ', '</div>' );
}
do_action( 'woocommerce_before_shop_loop_item' );
woocommerce_template_loop_product_link_open()
if ( ! function_exists( 'woocommerce_template_loop_product_link_open' ) ) {
/**
* Insert the opening anchor tag for products in the loop.
*/
function woocommerce_template_loop_product_link_open() {
global $product;
$link = apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product );
echo '<a href="' . esc_url( $link ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
}
}
remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
add_action( 'woocommerce_before_shop_loop_item', 'custom_open_link', 10 );
function custom_open_link() {
?>
<a href="<?php the_permalink() ?>">
<?php
}
<div class="single-share">
<a href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>" target="_blank">
<?php __('Поделиться в Facebook') ?>
</a>
<a href="https://twitter.com/home?status=<?php the_permalink(); ?>" target="_blank">
<?php __('Поделиться в Twitter') ?>
</a>
<a href="https://telegram.me/share/url?url=<?php the_permalink(); ?>&text=<?php the_title() ?>" target="_blank">
<?php __('Поделиться в Telegram') ?>
</a>
</div>
.slider-wrapper {
margin-left: calc(50% - 1140px/2);
padding-left: 15px;
padding-right: 15px;
}
.slider-wrapper {
.slick-slide {
margin: 0 15px;
}
.slick-list {
margin: 0 -15px;
padding: 0 10% 0 0;
}
}
<div class="wrapper">
<div class="tabs">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="tab"><?php the_title() ?></div>
<?php endwhile; ?>
<?php endif; ?>
</div><!-- tabs -->
<div class="tab-content">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="tab-item">
<?php the_excerpt() ?>
<a href="<?php the_permalink() ?>">Читать далее</a>
</div>
<?php endwhile; ?>
</div><!-- tab-content -->
<?php endif; ?>
</div><!-- wrapper -->
<script>
$('.tab-item').not(':first').hide();
$('.wrapper .tab').on('click', function() {
$('.wrapper .tab').removeClass('active').eq($(this).index()).addClass('active');
$('.tab-item').hide().eq($(this).index()).fadeIn();
}).eq(0).addClass('active');
</script>