• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WordPress Tips, Code Snippets, and How To Tutorials

  • Home
  • Blog
  • Tips
  • Snippets
  • Tutorials
  • Contact

How to add custom pagination page navigation to WooCommerce

May 22, 2015 by admin 20 Comments

How to add custom pagination page navigation to WooCommerceIf you have used the WooCommerce eCommerce plugin for WordPress, you have seen that the default Next and Previous Page links pagination page navigation is not very pretty. Today’s snack is a Tutorial that shows you how to add the WordPress plugin WP-PageNavi to a WooCommerce WordPress site in 3 easy steps to make your product archive page navigation easier to use and improve it’s look with numbered blocks instead of just next/previous links.

You can download this free WordPress Pagination plugin at: WordPress.org’s Plugin Repository – WP-PageNavi.

Step 1:

You should download and install WP-PageNavi into your WordPress plugins directory and then activate the plugin in your WordPress Dashboard.

Step 2:

Once it is installed, you can set up the options using the settings page for this plugin in your WordPress Dashboard.

Step 3:

After you have the settings set up, add this code below to your current theme’s Functions.php file to have WP-PageNavi’s pagination replace WooCommerce’s default page navigation:

/**
 * Replace WooCommerce Default Pagination with WP-PageNavi Pagination
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
remove_action('woocommerce_pagination', 'woocommerce_pagination', 10);
function woocommerce_pagination() {
		wp_pagenavi(); 		
	}
add_action( 'woocommerce_pagination', 'woocommerce_pagination', 10);

That’s it, now you have a much better looking and easier to use Pagination Page Navigation on your WooCommerce Product Archive Pages.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: WordPress Tutorials Tagged With: Functions.php, Pagination, Plugins, WooCommerce

Reader Interactions

Comments

  1. mattrhysdavies says

    April 3, 2012 at 11:58 am

    I’ve tried deploying this, the links show correctly, but the content doesn’t change when you paginate your way through.
     
    Any ideas?
     

    Reply
    • WPSnacks says

      April 4, 2012 at 5:05 pm

       @mattrhysdavies Sorry, but I’m not sure why it wouldn’t be working.  I just  checked to make sure it works with the most recent update of the plugins and it is working correctly.  You are using this with both the WooCommerce and WP-PageNavi plugins?  Also, how do you have your permalinks set up?

      Reply
      • mattrhysdavies says

        April 4, 2012 at 8:15 pm

         @WPSnacks Thanks for getting back to me. It turns out I was just making a hideous oversight and had another loop further up the page. I really appreciate the information provided and the reply.
         
        Thanks,
        Matt

        Reply
        • WPSnacks says

          April 4, 2012 at 8:57 pm

           @mattrhysdavies No problem, I’m glad you figured out the problem and got it working.  Thanks for your feedback and kind words!

          Reply
        • fanjava says

          April 19, 2012 at 4:04 am

           @WPSnacks
           How i can start configure in both woocommerce and pagenavi?
          Please help me 🙁

          Reply
  2. WPSnacks says

    April 4, 2012 at 5:04 pm

    Sorry, but I’m not sure why it wouldn’t be working.  I just  checked to make sure it works with the most recent update of the plugins and it is working correctly.  You are using this with both the WooCommerce and WP-PageNavi plugins?  Also, how do you have your permalinks set up?

    Reply
  3. purpleblaze says

    August 22, 2012 at 4:30 am

    Thanks for the great post! Was very useful! How would I change the location? I want it at the top of the page instead of the bottom… 

    Reply
  4. JohanVandeMerwe says

    October 18, 2012 at 3:06 pm

    Thanks, this was real easy and it works like a charm.

    Reply
  5. colorfultimes says

    November 24, 2012 at 10:17 am

    Appreciated. Thanks.

    Reply
  6. eric_wijaya says

    April 14, 2013 at 10:47 pm

    Thanks, work like a charm

    Reply
  7. karzin says

    April 18, 2013 at 5:23 pm

    I had to add these lines to remove the woocommerce pagination: remove_action(‘woocommerce_pagination’, ‘woocommerce_catalog_ordering’, 20); remove_action(‘woocommerce_pagination’, ‘woocommerce_pagination’, 10); remove_action(‘woocommerce_pagination’, ‘woocommerceframework_pagination’, 10); remove_action(‘woocommerce_pagination’, ‘woocommerce_pagination_wrap_open’, 5); remove_action(‘woocommerce_pagination’, ‘woocommerce_pagination_wrap_close’, 25);

    Reply
  8. f1mktsol says

    May 26, 2013 at 2:48 am

    I had to add some CSS to get rid of the Woo and allow only WP PageNavi to display:
    .woo-pagination {display: none; }

    Reply
  9. FlorifelBalaisValdenibro says

    July 8, 2013 at 11:35 pm

    I’ve followed the steps above but nothing happened. Still no pagination in my recent products. Pls help me. thanks.

    Reply
  10. mikulspatel says

    February 17, 2014 at 1:13 pm

    I’ve followed the steps above but nothing happened. Still no pagination in my category products. Pls help me. thank you.

    Reply
  11. Flo Nelson says

    May 1, 2017 at 4:25 pm

    Thanks – works perfectly!

    Reply
  12. cdy says

    October 23, 2017 at 6:46 pm

    Works great, thank you!

    Reply

Trackbacks

  1. How to add custom pagination to your Woocommerce - Mark van der Putten says:
    June 4, 2012 at 6:16 pm

    […] https://wpsnacks.com/wordpress-tutorials/how-to-add-custom-pagination-page-navigation-to-woocommerce/ […]

    Reply
  2. Super useful WooCommerce code snippets says:
    February 6, 2017 at 5:13 pm

    […] Source: WP Snacks […]

    Reply
  3. Super useful WooCommerce code snippets | MotionBump Reader says:
    February 6, 2017 at 6:03 pm

    […] Source: WP Snacks […]

    Reply
  4. WordPress action hooks and filters: practical examples | MotionBump Reader says:
    May 15, 2017 at 12:08 pm

    […] Source: WP Snacks […]

    Reply

Leave a Reply to WordPress action hooks and filters: practical examples | MotionBump Reader Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Hey, We Deliver... Anywhere!

Enter Email Address below to receive our snacks via email:

Join Over 1200 Readers!

Jump To A Random WordPress Tip

Copyright © 2019 • wpsnacks.com