Custom sorting options (asc/desc)

This example code shows how you can add an order option for ‘random’, but this also works in similar ways for other ways to order your products on the catalog page. To learn more about the default ‘orderby’ options please see the WordPress Codex Class Reference.

You need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

https://gist.github.com/woogists/b679a54a22ae8ddbb7cb4f0c91a90a53


Keep yourself in the loop!

This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form