Site logo

Archived topic

product categories

13 replies · Started by Łukasz on May 31, 2021

Viewing posts 1–14 of 14

How to make product categories displayed on the store's website non-alphabetically?

see link:
product categories:
MIÓD
ŚWIECE
WSZYSTKIE POZOSTAŁE

and I would like to:
ŚWIECE
WSZYSTKIE POZOSTAŁE
MIÓD

Hi Lukasz,

Try this CSS:

.archive ul.woo-cat-nav li:nth-child(1) {
    order: 3;
}

Let me know :)

Where should I paste this css code?
I don't know much about it :(

Hi there,

you can add it to the Customizer > Additional CSS

I have added CSS code to Customizer> Additional CSS, but what next, how do I change the category display?
I need more tips

Aah i should have read your original topic.
Remove that CSS - its not required.

Then go to Dashboard > Appearance > Elements and edit the Hook titled: Woocommerce Shop Category Menu
In there you will see some PHP Code.

Change this line:

'orderby' => 'name',

to:

'orderby' => 'menu_order',

And save that change.

Then edit your Product Categories, and drag them into the order you want them displayed.

I did exactly that, but it doesn't work

This is what i see when i visit your site:

https://www.screencast.com/t/gJWSBHxD01

Which, apart from the additional Category, they are in the order you asked for above. Maybe the browser cache needs clearing?

Yes it's true, but on the home page is alphabetically.
As far as I can see there is a code:
Shortcode [product_categories number="0" parent="0" limit="3" columns="3"]

on the home page it is alphabetical and also when i open the hamburger menu it is alphabetical PRODUCT CATEGORIES

Did you update the shortcode to this on your home page:

[product_categories number="0" parent="0" limit="3" columns="3" orderby="menu_order"]

I just tested this and it works.

For the Off Canvas menu - go to Customizer > Widgets > Off Canvas, select the Product Categories widget, and change the Order By to Category Order

Everything works as I wanted! David, thank you very much :)

Glad to be of help

This archived topic is closed to new replies.