Answer the question
In order to leave comments, you need to log in
How to change the product size?
The product is presented in this way, but it is needed in this
way, the last photo was made by disabling media queries and a little css, but there is also a php request to the section
<?php
$loop_args = array(
'post_type' => 'product',
'posts_per_page' => 5,
'product_cat' => '',
// 'meta_key' => 'total_sales',
// 'orderby' => 'meta_value_num',
// 'thumbs' => 'medium'
'tax_query' => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
),
),
);
$loop = new WP_Query($loop_args);
if ( $loop->have_posts() ) :
?>
<section class="product-hits">
<div class="container">
<div class="row">
<div class="col-12 product-hits__title">
<h2 class="if-title"><?php _e('Хіт продажів', 'ifranko'); ?></h2>
<a href="<?php echo get_permalink( woocommerce_get_page_id( 'shop' ) ); ?>" class="if-button if-button--white"><?php _e('Переглянути всі товари', 'ifranko'); ?></a>
</div>
<div class="col-12 product-hits__grid">
<?php while ($loop->have_posts()): $loop->the_post();
$product = wc_get_product( $loop->post );
?>
<div class="if-product">
<a href="<?php the_permalink(); ?>" class="if-product__link">
<?php if( has_post_thumbnail($loop->post->ID) ) : ?>
<div class="if-product__thumb progressive replace" data-href="<?php echo get_the_post_thumbnail_url( $loop->post->ID, 'large' ); ?>">
<!-- <img src="<?php echo SD_THEME_IMAGE_URI; ?>/iphone-7-2.jpg" alt=""> -->
<?php the_post_thumbnail('progressive', array(
'class' => "preview",
'alt' => 'image',
));
?>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question