WordPress.org

Support

Support » Plugins and Hacks » Only have 2 columns of products

Only have 2 columns of products

  • OB

    @reburton3941

    I have a somewhat familiar problem. I have the Artificer theme and my “Shop” page is only displaying two columns. I had this problem a while back and fixed it by deleting a totally unrelated line of code in my custom.css file. Well, I no longer have that line of code in there, but I deleted all of the contents of the file to see if another line was causing the problem. The display still only showed two columns! I have restored the custom.css file, but since I now have no clue what to do, I’m hoping someone else has an idea. The URL is http://www.olbinternetservices.com/shop/shop/
    Does anybody have any ideas?

    https://wordpress.org/plugins/woocommerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @ob, you can add below code into your theme functions.php:

    // Display 4 products per row
    add_filter('loop_shop_columns', 'custom_loop_columns');
    if (!function_exists('custom_loop_columns')) {
    	function custom_loop_columns() {
    		return 4;
    	}
    }
    OB

    @reburton3941

    terrytsang
    Thanks for answering!
    I really appreciate your help. Unfortunately I can’t use the code as it is because I actually need three columns. I am just beginning to get a handle on CSS, I know nothing about PHP. So, I don’t know how to alter the code to suit my need. Could you please send me a revised segment? I also don’t know where to insert the code. I’m just your average inexperienced wannabe programmer. :=) Thanks again!

    Hi @ob, at WordPress Admin, you can see “Apperance” sidebar menu on your left. Mouse over that and click “Editor” link. It will show “Edit Themes” page, default will be your current theme.

    On your right sidebar got a list of files, do click “Theme Functions (functions.php)” link. You will see the file content, do paste below code before symbol ‘?>’ :

    add_filter('loop_shop_columns', 'custom_loop_columns');
    if (!function_exists('custom_loop_columns')) {
    	function custom_loop_columns() {
    		return 3; //Display 3 products per row
    	}
    }
    OB

    @reburton3941

    Hi terrytsang,
    Thanks!
    It worked like a charm. I really appreciate the help. Be4st of luck!
    OB

    Hi terrytsang,
    I added these strings to the functions.php in my child theme, but there are still only 2 columns displayed. I also tried changing the number of columns by using the “WooCommerce Product Archive Customiser” plugin, but that didn’t help too. What am I doing wrong?
    http://pepisign.com/p/shop/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Only have 2 columns of products’ is closed to new replies.