Created
January 16, 2012 18:54
-
-
Save mikejolley/1622323 to your computer and use it in GitHub Desktop.
WooCommerce - Change default catalog sort order
This file contains hidden or 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 | |
} | |
This Gist has been mentioned on Stack Overflow a few times:
https://stackoverflow.com/questions/47627079/sort-products-by-desc-order-in-woocommerce
A few other related threads:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hoaiphatcr YOU saved my day!!!! thanks!!!