Free Tutorials Genesis Tutorials

WooCommerce Product Categories Widget – Change The Order Of Categories

This free code enables you to change the order of your categories displayed using the WooCommerce Product Categories widget.

On your WooCommerce > Products > Categories admin page, you can change the order of categories on the front-end using drag and drop to sort them.

add_filter( 'woocommerce_product_categories_widget_args'

Using the following code in your child themes functions file, you can change the default order.

Download Code – Free

Tested using the Genesis Sample child theme by StudioPress with the Genesis WooCommerce Connect plugin.

You can learn more about this hook in wp-content > plugins > woocommerce > includes > widgets > class-wc-widget-product-categories.php

The hook used in this function enables you to filter the wp_list_categories arguments used to display your product categories in the WooCommerce Product Categories widget.

You could also use the wp_list_categories hook ( Untested ) like this :


function modify_wooc_product_categories_order($output) {

// Add your modified arguments here

   return $output;

Leave a Reply

Your email address will not be published. Required fields are marked *