• Resolved eorsavik

    (@eorsavik)


    Hi,

    By default the no. of products displayed in Shop page is 12. I would like to change the no. to 40 by using some hook. I tried the following code, but its not working with OceanWP theme :

    add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 );
    function new_loop_shop_per_page( $cols ) {
    // Return the number of products you wanna show per page.
    error_log("avk : no. of products in shop page :- " . $cols) ;
    $cols = 40;
    return $cols;
    }

    When I try the same code with Storefront theme, it works perfectly fine. Looks like it is an issue with OceanWP theme. Do I need to use a different hook to achieve that when using OceanWP theme ?

    Thanks !!!

    • This topic was modified 2 years ago by eorsavik.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to change no. of products displayed in shop page programatically in OceanWP’ is closed to new replies.