You can do a lot with the free plugins available at WordPress.org, without any developer skills or with a limited budget, and this is probably the right course of action. If, however, you have time to dig into the code, then you can sometimes get modest speed increases by writing a few lines of code instead of loading a big plugin. With this recipe, I'm going to show you how to change the number of columns on your shop page without a plugin. We're going to code it manually.
You'll need to have a few products on your site so that you can see how the columns rearrange.
In order to change the number of columns on the Shop page, go through the following steps:
functions.php
file, located under wp-content/themes/your-theme-name/
. Optionally, you could create your own custom WooCommerce plugin as instructed in the Creating a WooCommerce plugin recipe in Chapter 1, WooCommerce Basics.add_filter( 'loop_shop_columns', 'woocommerce_cookbook_loop_shop_columns', 20 ); function woocommerce_cookbook_loop_shop_columns( $cols ) { return 3; }
If you save and upload this file, you'll notice that there are three columns, but they don't look very good because we haven't changed our CSS. To make this look nice, we have to alter our CSS to match.
style.css
stylesheet so we can add some extra styles..woocommerce ul.products li.product, .woocommerce-page ul.products li.product{ width: 30.75% }
Your columns should now fill the available space.
Some custom themes use pluggable functions. If the number of columns isn't changing, there are some alternative ways to write this code so that it works with pluggable functions. You can find a few examples at http://docs.woothemes.com/document/change-number-of-products-per-row/.