WordPress.org

Forums

WooCommerce - excelling eCommerce
Only have 2 columns of products (6 posts)

  1. OB
    Member
    Posted 12 months ago #

    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/

  2. terrytsang
    Member
    Posted 12 months ago #

    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;
    	}
    }
  3. OB
    Member
    Posted 12 months ago #

    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!

  4. terrytsang
    Member
    Posted 12 months ago #

    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
    	}
    }
  5. OB
    Member
    Posted 12 months ago #

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

  6. krokopotam
    Member
    Posted 9 months ago #

    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/

Reply

You must log in to post.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.