Skip Navigation

[Résolu] View List Display Order

This support ticket is created Il y a 5 années et 10 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 5 années et 10 mois.

Assisté par: Nigel.

Auteur
Publications
#1187760
ordering.png
dropdown.png

On my website, I've got a car listing with pagination & a custom search.

The cars are categorized using a custom field called "sale status" select dropdown field.

There are three options in the select field type, for sale, sold & in stock.

When viewing the listing, I need "for sale cars" to show first, then "in stock" & lastly sold ones.

I attached how I have set up my custom field & the view ordering. I did play around with views ordering but none of the options helped.

Please let me know how I can achieve this listing order.

Cheers

#1188005

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

If you are ordering the output of a View by a custom field, it is the field value which is relevant (not the display text of the field).

The simplest solution to achieve the ordering you require is to change the values stored in the database for this field, e.g. to

For sale 	1
In stock	2
Sold		3

You would need to re-save your posts to update the stored values, though.

Also, this will order the posts as required, but it doesn't group them such that you can have headings between each set of results.