woocommerce_default_catalog_orderby desc
/** * 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 }
Here is what the above code is Doing:
1. It’s adding a filter to the default catalog orderby.
2. It’s returning the default catalog orderby as date.
You can also use title and price as the default catalog orderby.