Skip to content

Instantly share code, notes, and snippets.

@ejntaylor
Last active May 17, 2020 06:06
Show Gist options
  • Save ejntaylor/6771672 to your computer and use it in GitHub Desktop.
Save ejntaylor/6771672 to your computer and use it in GitHub Desktop.
Replace WooCommerce Default Pagination with WP-PageNavi Pagination for Woo Canvas or WooCommerce Pagination
/**
* Replace WooCommerce Default Pagination with WP-PageNavi Pagination for Woo Canvas
**/
add_action('init','alter_woo_hooks');
function alter_woo_hooks() {
remove_action( 'woocommerce_after_main_content', 'canvas_commerce_pagination', 01, 0 );
}
add_action( 'woocommerce_pagination', 'woocommerce_pagination', 1 ); // < 2.0
add_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 1 ); // < 2.0+
function woocommerce_pagination(){
wp_pagenavi();
}
/**
* Replace WooCanvas Default Pagination with WooCommerce Pagination
**/
add_action('init','alter_woo_hooks');
function alter_woo_hooks() {
remove_action( 'woocommerce_after_main_content', 'canvas_commerce_pagination', 01, 0 );
}
add_action( 'woocommerce_pagination', 'woocommerce_pagination', 1 );
add_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 1 );
@ejntaylor
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment