• brown7905

    (@brown7905)


    I am working with someone to create a store on their site using WooCommerce.

    I have tried literally everything to change the number of products that appear on the front page and no matter what I do it will not change.

    The code I’ve been trying on functions.php (among many others) is

    // Display 24 products per page. Goes in functions.php
    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );

    It hasn’t worked. I’ve also tried to change the number of posts under Settings>Reading. No luck there.

    I was able to change to the number of columns by using this code

    // Change number or products per row to 3
    add_filter('loop_shop_columns', 'loop_columns');
    if (!function_exists('loop_columns')) {
    	function loop_columns() {
    		return 3; // 3 products per row
    	}
    }

    For some reason this worked in functions.php, so I have no idea why the number of products changing isn’t working here.

    The site is https://www.melissatucker.com/shop

    If anyone has any ideas I’d really appreciate it!

    https://www.ads-software.com/extend/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • mattprice1707

    (@mattprice1707)

    I see from looking at your code that you’re using an elegant themes theme. These options can be changed in epanel>generalsettings>homepage. Where it says ‘number of recent posts displayed on homepage’ set it to whatever number that you want.

    moodytryme

    (@moodytryme)

    Hi !

    I’m having a conflict with the WordPress blog pagination and the WP e commerce pagination, and I was told to desactivate the Pagination on Products page (Store > Presentation Settings > Pagination settings : No)
    https://www.ads-software.com/support/topic/wp-e-commerce-problem-with-blog-categories-pagination?replies=4

    Then I tried making the pagination work manually on Products page by using your code :

    // Display 24 products per page. Goes in functions.php
    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );

    but it doesn’t work.
    I also tried another code but it still won’t work.

    $wpsc_count_products = 4;

    Do you know how I can display manually the number of products per page. And by not using shortcodes.

    ELGNAT THEMES!!!! Wragh….

    Thanks mattprice1707 for the solution … I was searching for hours.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing number of products displayed on page’ is closed to new replies.