• Resolved mrsdextrose

    (@mrsdextrose)


    Hi I have my woocommerce shop on my homepage, which was great for SEO, but now the shop has built up (to well over 100 products with images) it’s started to crash on mobiles. I need to split my shop into sections, but showing the user the overflow pages so they can navigate through the whole shop.

    I’m using the basic shortcode

    [recent_products per_page=”200″ columns=”4″ orderby=”rand” order=”rand”]

    If I change that to

    [recent_products per_page=”48″ columns=”4″ orderby=”rand” order=”rand”]

    it only shows 48 products, no 1 2 3 after to show there are further pages.

    I don’t know php – though I can make php changes without properly understanding the code – or maybe there’s an obvious solution I’m missing?

    Advice always appreciated.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    add following code into your function.php file:

    add_filter(‘loop_shop_per_page’, create_function(‘$cols’, ‘return 48;’));

    You need to fix post per page in admin at Settings >> Reading section.

    Thread Starter mrsdextrose

    (@mrsdextrose)

    Thanks very much, Ash

    You welcome ..!!!

    Thread Starter mrsdextrose

    (@mrsdextrose)

    Ah. Just tried this and I couldn’t get it to work. Placed this code

    <?php

    add_filter(‘loop_shop_per_page’, create_function(‘$cols’, ‘return 48;’));

    ?>

    first in a functions.php file in a child theme, then same code at the end of the functions.php file of the main theme, in case had messed up child (having also changed blog posts per page to 48 in Settings>>Reading). Both attempts display the full shop as before.

    Am I missing something obvious? Thanks

    Try to put this code in to one function file only…
    either parent or child..
    Meanwhile it should effect if you set number of blog per page to 48 from admin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Need to split Woocommerce shop’ is closed to new replies.