WordPress.org

Ready to get started?Download WordPress

Forums

Woocommerce - Products per row (2 posts)

  1. DesignLoud
    Member
    Posted 1 year ago #

    Man, I have been racking my brain on this one, maybe someone can chime in with a little more knowledge of Woo.

    I want to change the number of products displayed per row depending on category. I am working with a photographer to setup his store and he shoots both vertical and horizontal panoramics. While I currently have the horizontals 3 to a row (want to keep this so they are not too small) I would like to have the verticals display 5 per row.

    Anyone know of a way to accomplish this? I was thinking an if/else statement or switch case but my tired eyes could not get it to work.

    All help is greatly appreciated!

  2. DesignLoud
    Member
    Posted 1 year ago #

    Anyone able to chime in on this? This is what I thought would work, maybe someone see's something I am missing...

    add_filter('loop_shop_columns', 'loop_columns');
    if (!function_exists('loop_columns')) {
    function loop_columns() {
    	if (is_product_category('verticals')) {
    		return 4;
    	} else {
    		return 3;
    	}
    	}
    }

Topic Closed

This topic has been closed to new replies.

About this Topic