Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon How do I replace Avia pagination with WooCommerce's default pagination


How do I replace Avia pagination with WooCommerce's default pagination


To replace Avia pagination with WooCommerce's default pagination in your theme, you can follow these steps:

Step-by-Step Guide

1. Remove Avia Pagination:
You need to remove the existing Avia pagination from the WooCommerce shop page. You can do this by adding the following code to your theme's `functions.php` file:

php
   add_action('after_setup_theme', 'custom_woocommerce_pagination');
   function custom_woocommerce_pagination() {
       remove_action('woocommerce_after_shop_loop', 'avia_woocommerce_after_shop_loop', 10);
   }
   

This code snippet removes the Avia pagination function from the WooCommerce loop.

2. Add WooCommerce Default Pagination:
After removing the Avia pagination, you can add the default WooCommerce pagination by using the following code:

php
   add_action('woocommerce_after_shop_loop', 'woocommerce_pagination', 10);
   

This will insert the default WooCommerce pagination at the bottom of your product listings.

3. Custom Pagination (Optional):
If you want to customize the pagination further or use a specific pagination plugin, you can do so by modifying the pagination settings in your theme or using additional functions. For example, if you are using a pagination plugin like WP-PageNavi, you can integrate it as follows:

php
   add_action('woocommerce_after_shop_loop', 'custom_wp_pagenavi', 10);
   function custom_wp_pagenavi() {
       if (function_exists('wp_pagenavi')) {
           wp_pagenavi();
       }
   }
   

Conclusion

By following these steps, you can effectively replace the Avia pagination with WooCommerce's default pagination on your shop page. Ensure you test the changes on your site to confirm that the pagination behaves as expected.

Citations:
[1] https://gist.github.com/ejntaylor/6771672
[2] https://gist.github.com/yanknudtskov/6565d4c6983a73e65fb5b6fa16253abc
[3] https://wordpress.stackexchange.com/questions/289387/remove-default-pagination-on-woocommerce-shop-page
[4] https://www.8theme.com/topic/how-to-change-default-woocommerce-pagination/
[5] https://stackoverflow.com/questions/69495135/change-pagination-base-slug-on-woocommerce-archive-product-page