Add WooCommerce Product Category Dropdown to Shop & Archive Pages

WooCommerce has a Product Category dropdown list of available product categories which filter and refresh the page based on product selection. It is assigned via a Widget and easy enough to put in the sidebar.

But what about adding it to the top of the main shop and archive pages.?



Here is  a way to display it in the main shop area just below the headline, in essence you create a new widget and position it below the WooCommerce page title.

So in the above code which goes into functions.php a new widget is created named ‘Product Cat Sort’ and positioned outside before the WooCommerce loop and after the headline – it will appear whenever there is a WooCommerce product loop so all the archive pages are covered. All you need to do is add the dropdown to it in the widget area.

If your product pages have a sidebar then you can also use a sidebar widget in your theme to position the dropdown there – that way you have both archive and single pages covered.

1 Comment

  1. varan on January 25, 2018 at 12:06 pm

    It works great, thank you very much. Is it also possible to add this to the product page it self. So if someone clicks on the product and also can go trough the categorie.

Leave a Comment

%d bloggers like this: