Skip to content

Instantly share code, notes, and snippets.

@organizm
Created June 27, 2016 14:40
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 organizm/545d1b66fd78c0d1442229f0e1e788c0 to your computer and use it in GitHub Desktop.
Save organizm/545d1b66fd78c0d1442229f0e1e788c0 to your computer and use it in GitHub Desktop.
WooCommerce - Change default catalog sort order #woocommerce #wordpress
<?php
/**
* This code should be added to functions.php of your theme
**/
add_filter('woocommerce_default_catalog_orderby', 'imperialfashion_custom_default_catalog_orderby');
function imperialfashion_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