Skip to content

Instantly share code, notes, and snippets.

@zverush
Last active January 18, 2016 08:13
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 zverush/079e7d64941fe39161c1 to your computer and use it in GitHub Desktop.
Save zverush/079e7d64941fe39161c1 to your computer and use it in GitHub Desktop.
WooCommerce - Change default catalog sort order
<?php
// https://gist.github.com/mikejolley/1622323
add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby');
function am_woocommerce_catalog_orderby( $args ) {
$args['meta_key'] = '_price';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'desc';
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment