C
C
Cherkiy2020-12-15 19:16:40
WordPress
Cherkiy, 2020-12-15 19:16:40

How to change the product size?

The product is presented in this way, 5fd8e08c919de418822274.png but it is needed in this 5fd8e0b82fde7974922732.pngway, 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>


Further, part of the code deviates from the goal I need, so only this part of the code

The bottom line is, I need to understand how the code works and how to remove the increase

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question