Answer the question
In order to leave comments, you need to log in
Why is the Wordpress loop not working properly with the Woocommerce plugin?
The essence of the problem is this, if the loop is written like this:
<?php $country = new WP_Query(
array(
'post_type' => 'product',
'posts_per_page' => 10,
'orderby' => array( 'title' => 'ASC', 'menu_order' => 'ASC' )
)
); ?>
<?php while ( $country->have_posts() ) : $country->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : ?>
Answer the question
In order to leave comments, you need to log in
Hello!
I'm not sure if it's the loop that's the problem, since you only provided a piece of code...
I can assume the following...
It wraps each product in this block, since it is in a cycle and, accordingly, due to CSS, each element is on a new line.
Check out this div's CSS... you should now have something like display:block; width:100% etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question