in Wordpress Themes by mark85 (180 points)

How can I change from 2 columns of products per page to 3 or 4 columns. 

I have tried adding the following to the end of functions.php - 

// Override theme default specification for product # per row
function loop_columns() {
return 5; // 5 products per row
}
add_filter('loop_shop_columns', 'loop_columns', 999);
The problem I have is that this only works if its outside on the "?>" which closes the php. But then it also displays the override code at the top of the page.

 

1 Answer

by lisa-west (35.1k points)
Hi,

Please add your code after the ?> PHP closed. Again start PHP <?php Add your code and close the php ?>
by mark85 (180 points)
I have tried this and then it does not add the extra columns of products. It works if the code is added outside of any <?php .... ?> , but then also displays the code at the top of the webpage.
Interested in localizing/Translating TemplateToaster Software in your native language in exchange of a Pro License ? Contact Us
...