# Number of Columns on the Shop Page

> Changes the number of product columns on the shop and product category pages for classic themes.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, shop, layout
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-shop-columns/

## Code

```php
add_filter( 'loop_shop_columns', function () {
    return 3;
}, 20 );
```

## Notes

Some themes control columns themselves and ignore this filter.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Number of Columns on the Shop Page" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
