Created
April 11, 2017 07:50
-
-
Save RiaanKnoetze/684472fb6052b7ea9c75a153d07da61b to your computer and use it in GitHub Desktop.
Storefront change categories to be ordered by date.
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
/** | |
* Alters the output of the homepage product categories on the Storefront theme | |
* Affects the storefront_product_categories_args filter in /inc/structure/template-tags.php | |
*/ | |
function rk_display_four_home_product_categories( $args ) { | |
// Sets the categories to be ordered by date, instead of name | |
$args['orderby'] = 'date'; | |
// Output | |
return $args; | |
} | |
add_filter( 'storefront_product_categories_args', 'rk_display_four_home_product_categories' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment