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
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.