1
Has a virtual store that displays the products in the home... products in category A and products in category B. Those in category A are the main ones, those in the secondary category B. So at home the Thumbs of category B products have to be smaller than those of category A. I need to reduce them but only know reduce of all.
Doing this without putting your hand in the code I think it’s impossible, no? I haven’t found any plugin for this.
I tried to use the code below, I inserted it into a page called loop-page in my theme and it didn’t work. I wanted to try to insert by code and thus have greater freedom with the html/css of the products. With the shortcode, I was able to organize using float:left, etc, but if I use width and height only cuts.
<?php
$args = array(
'post_type' => 'product',
'meta_key' => '_featured',
'meta_value' => 'yes',
'posts_per_page' => 1
);
$featured_query = new WP_Query( $args );
if ($featured_query->have_posts()) :
while ($featured_query->have_posts()) :
$featured_query->the_post();
$product = get_product( $featured_query->post->ID );
// Output product information here
endwhile;
endif;
wp_reset_query(); // Remember to reset ?>
And how do you reduce all Humbs? How are you differentiating one category from another? Which shortcode are you using? Why is your code only pulling 1 product per page? How are you doing the
Output product information
?– brasofilo
This code was an example that I inserted in the template’s home file that I use to try to call the products in the traditional way with shortcode, where there is 1 could be another value, anyway but it did not work. I was using [product_categories number=""], as I had to put the products in a specific order I am using a by shortcode [product id="2243"] [product id="2240"] [product id="2234"]... To change the size of all is in Tools>Regen. Thumbnails
– user49915