Change number of products per row

Defines where ‘first’ and ‘last’ classes are applied in product archives.

Please be aware that some third-party themes may be coded in a way that the snippets below have no effect on layout. In this case, we recommend you contact the theme author.

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy.

Custom theme ↑ Back to top

If you’re building a theme it may be useful to make this pluggable for other developers. When included in your theme, other developers will be able to customise this function.

Theme by Woo ↑ Back to top

If you’re using a WooTheme then this code may have been utilised in the theme. It will already be pluggable which means you’ll need to redefine the function in your functions.php file (preferably in a child theme) to overwrite the theme default.

Shortcode ↑ Back to top

Use the WooCommerce shortcodes on your archive page.

[recent_products per_page="12" columns="5"] will display the products in rows of 5 columns.

Plugin ↑ Back to top

Alternatively, you may want to try the WooCommerce Product Archive Customizer plugin, which includes an option to change the number of products displayed per row and more.

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top