Skip to content

Instantly share code, notes, and snippets.

@xlawok
Created June 17, 2020 16:30
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 xlawok/e018499438f9dbe36fb9a7e9c0f8e956 to your computer and use it in GitHub Desktop.
Save xlawok/e018499438f9dbe36fb9a7e9c0f8e956 to your computer and use it in GitHub Desktop.
woocommerce change order achive PRODUCT based on tag possible category also
//REARRANGE PRODUCT IN NOWOŚCI TAG
add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby');
function custom_default_catalog_orderby($sort_by) {
if( !is_tax( 'product_tag', 'Nowości' ) ) {
return $sort_by;
}
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