-
AuthorPosts
-
December 17, 2014 at 10:24 pm #369774
I’m trying to create a widget or code that outputs WooCommerce product thumbnails in a grid.
Similar to this site’s sidebar section labeled “Some of our themes”.
The default WooCommerce product widget shows the products as a list with title and price. I only want the thumbnails to show in a grid.
Are there existing styles to use for a thumbnail grid in Enfold?
I wrote custom code that was placed in a text/php widget that worked when I was using the Woothemes Canvas theme.
Here’s what it looked like:
<ul class="thumbnails"> <?php $my_query = new WP_Query( array( 'post_status' => 'publish', 'post_type' => 'product', 'posts_per_page' => 8, 'meta_query' => array( array( 'key' => '_stock_status', 'value' => 'instock', 'compare' => '=' ) ) ) ); if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?> <li class="col-lg-2"> <a class="thumbnail" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail('thumbnail-m-c', array('class' => '')); ?> </a> </li> <?php endwhile; endif; ?> </ul>
Any help or insight would be appreciated. Whether it’s CSS or a recommended plugin.
Seems like there should be something out there for WooCommerce sites wanting an optional way to display products in the sidebar.
December 18, 2014 at 5:08 pm #370057Hey mattmikulla!
We have a grid shortcode for displaying products. When your in the advanced layout editor click on “Plugin Additions” and you can see some of our shortcodes for displaying products.
If you only want the thumbnails to display then we can do some CSS to hide the other stuff. Go ahead and send us a link to your site. You can set your reply as private if you wish.
Woocommerce also has a lot of shortcodes you can use, http://docs.woothemes.com/document/woocommerce-shortcodes/.
Best regards,
Elliott -
AuthorPosts
- You must be logged in to reply to this topic.