Skip to content

Instantly share code, notes, and snippets.

@pvphong90
Last active September 20, 2018 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvphong90/8f6e8db3cc35b6982975d89790d7562c to your computer and use it in GitHub Desktop.
Save pvphong90/8f6e8db3cc35b6982975d89790d7562c to your computer and use it in GitHub Desktop.
Bỏ đi bộ lọc sản phẩm
// Tùy chỉnh các tùy chọn sắp xếp sản phẩm WooCommerce
// Tùy chọn có sẵn là: menu_order, xếp hạng, ngày, mức độ phổ biến, giá, giá-desc
function custom_woocommerce_product_sorting( $orderby ) {
// The following removes the rating, date, and the popularity sorting options;
// feel free to customize and enable/disable the options as needed.
unset($orderby["rating"]);
unset($orderby["date"]);
unset($orderby["popularity"]);
return $orderby;
}
add_filter( "woocommerce_catalog_orderby", "custom_woocommerce_product_sorting", 20 );
<!-- Hoặc code sau -->
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
//Chọn 1 trong 2 code trên nhé
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment