Skip to content

Instantly share code, notes, and snippets.

@nielsvr
Last active December 23, 2015 23:39
Show Gist options
  • Save nielsvr/6711405 to your computer and use it in GitHub Desktop.
Save nielsvr/6711405 to your computer and use it in GitHub Desktop.
Change the options of the WooCommerce orderby dropdown
<?php
// add in functions.php of your theme
// Change the options of the WooCommerce orderby dropdown
function modify_woocommerce_orderby( $orderby ) {
unset($orderby["popularity"]);
unset($orderby["pricemenu_orderdesc"]);
unset($orderby["rating"]);
unset($orderby["date"]);
// unset($orderby['menu_order']);
// unset($orderby['price']);
// unset($orderby['price-desc']);
return $orderby;
}
add_filter( "woocommerce_catalog_orderby", "modify_woocommerce_orderby", 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment