Skip to content

Instantly share code, notes, and snippets.

View steppohub's full-sized avatar

Steppo steppohub

View GitHub Profile
@BFTrick
BFTrick / woocommerce-modify-orderby.php
Last active July 26, 2018 14:07
A function that modifies the default WooCommerce orderby dropdown. You can put this snippet in your functions.php file.
<?php
// Modify the default WooCommerce orderby dropdown
//
// Options: menu_order, popularity, rating, date, price, price-desc
// In this example I'm removing price & price-desc but you can remove any of the options
function patricks_woocommerce_catalog_orderby( $orderby ) {
unset($orderby["price"]);
unset($orderby["price-desc"]);
return $orderby;
}