Skip to content

Instantly share code, notes, and snippets.

@hollyboom
Forked from mikejolley/gist:1622323
Created February 11, 2018 08:37
Show Gist options
  • Save hollyboom/58647dec3e453e62f949f61907747e5d to your computer and use it in GitHub Desktop.
Save hollyboom/58647dec3e453e62f949f61907747e5d to your computer and use it in GitHub Desktop.
WooCommerce - Change default catalog sort order
/**
* This code should be added to functions.php of your theme
**/
add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby');
function custom_default_catalog_orderby() {
return 'date'; // Can also use title and price
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment