Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go theme bug: How to change number of columns and rows in Shop? #911

Open
1 task done
mayasouter opened this issue May 8, 2024 · 0 comments
Open
1 task done

Go theme bug: How to change number of columns and rows in Shop? #911

mayasouter opened this issue May 8, 2024 · 0 comments
Labels
[Type] Bug Something that is not working as expected

Comments

@mayasouter
Copy link

mayasouter commented May 8, 2024

Hi,

Hoping someone can help! I've trawled the internet for hours with this one and trialled a few workarounds with no luck...

In the Go Theme Woocommerce Shop page for sudsandbuds.co.uk/shop, there are always only 3 columns and 3 rows, no matter what number I enter in the box at the end of this path: 'Dashboard - Appearance - Customise - WooCommerce - Products Catalogue - Products per row'

I'm trying to get 4 columns and 4 rows. I'll settle for 4 columns and 3 rows but I can't seem to change the amount of either rows or columns.

Here's a screenshot of my shop with the 3 columns:

image

Weirdly, the shop displays 4 columns for my two subcategories ('topped soaps' and 'smooth soaps'):

image

I've created a child theme (parent: 'Go') and entered code via 'Appearance - Theme file editor'. I've also entered code via 'Snippets - Add New' as well as directly to the Go theme itself via 'Appearance - 'Theme file editor'. None of the approaches work. Here are 5 of the codes I've trialled:


// Change the Number of Columns Displayed Per Page
add_filter( 'loop_shop_columns', 'lw_loop_shop_columns' );
function lw_loop_shop_columns( $columns ) {
 $columns = 4;
 return $columns;
}

@media (min-width: 768px) {
    ul.products.columns-4 li.product {
        width: 25%;
    }
}

// Change number of products per row to 4
add_filter('loop_shop_columns', 'custom_loop_columns', 999);
function custom_loop_columns() {
    return 4; // Change this number to the desired number of columns
}

add_filter('loop_shop_columns', 'woo_loop_columns', 999);
if (!function_exists('woo_loop_columns')) {
 function woo_loop_columns() {
  return 4; // 4 products per row
 }
}

}
// change number of columns
add_filter( 'loop_shop_per_page', 'new_loop_col_shop_per_page', 20 );
function new_loop_col_shop_per_page( $cols ) {
  // Return the number of products you wanna show per page.
  $cols = 3;
  return $cols;
}

Any suggestions? I'm lost with this!

Best wishes
Maya

Priority (select one):

  • Medium - Doesn't work as expected
@mayasouter mayasouter added the [Type] Bug Something that is not working as expected label May 8, 2024
@mayasouter mayasouter changed the title Go theme bug: In the Shop, there are always only 3 columns and 3 rows, no matter what number I enter Go theme bug: How to change number of columns and rows in Shop? May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something that is not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant