-
-
Save hollyboom/58647dec3e453e62f949f61907747e5d to your computer and use it in GitHub Desktop.
WooCommerce - Change default catalog sort order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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