[Support request] Reduce pagination pages/buttons

Home Forums Support [Support request] Reduce pagination pages/buttons

Home Forums Support Reduce pagination pages/buttons

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1383532
    igor96

    Hi guys! ๐Ÿ™‚
    My pagination bar is overflowing on mobile.
    Are there any easy ways to reduce the number of pages in it with GP?
    Ciao from Italy ๐Ÿ˜‰

    #1383558
    Leo
    Staff
    Customer Support

    Hi there,

    Are you referring to the WooCommerce pagination?

    If so that’s handled by WooCommerce and I believe this filter would be what you need:
    http://hookr.io/filters/woocommerce_pagination_args/

    #1908552
    Mihail

    Are you referring to the WooCommerce pagination?

    If so thatโ€™s handled by WooCommerce and I believe this filter would be what you need:
    http://hookr.io/filters/woocommerce_pagination_args/
    `

    How to use it?

    I added both codes, but nothing happened…

    my functions.php
    https://prnt.sc/1qiu6mw

    results:
    https://prnt.sc/1qiu79i

    #1908618
    Elvin
    Staff
    Customer Support

    Hi there,

    You need to add the things you need to change.

    You may want to adjust mid size and end size value. That’s the number of page links that displays.

    By default, it’s 3. Change it to your preference.

    Example:

    // define the woocommerce_pagination_args callback 
    function filter_woocommerce_pagination_args( $array ) { 
        $array = array( 
          'base' => esc_url_raw(str_replace(999999999, '%#%', remove_query_arg('add-to-cart', get_pagenum_link(999999999, false)))),  
          'format' => '',  
          'current' => max(1, get_query_var('paged')),  
          'total' => $wp_query->max_num_pages,  
          'prev_text' => 'โ†',  
          'next_text' => 'โ†’',  
          'type' => 'list',  
          'end_size' => 1,  
          'mid_size' => 1 
     );
        return $array; 
    }; 
             
    // add the filter 
    add_filter( 'woocommerce_pagination_args', 'filter_woocommerce_pagination_args', 10, 1 );
    #1918885
    Mihail

    I added your code to functions.php and now the buttons are gone.

    https://prnt.sc/1r7zcpr
    https://prnt.sc/1r7zfgs

    test site:
    https://spojler.ru/shop/

    #1919110
    Leo
    Staff
    Customer Support

    That’s a WooCommerce filter so please check with their support team.

    You can also Google woocommerce_pagination_args to see some examples.

    Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.