Hello guys,
i have a funeral as a customer and he has related deaths on his homepage. Now he got a new website (before a custom-cms – now wordpress) so i imported all the old deaths to his new site.
I did it with wp_insert_post and update_field(key, value, postID)
The Death-Die-Date as example was 01.03.2000 (dd.mm.yyyy) so i said update_field(“field_57ab37111706a”, “01.03.2000”, 1241)
In the backend when i want to edit a death then the death-die-date is perfectly filled in and i can also show it in the frontend, but the problem ist the sorting.
in my frontend i have a page that shows the last 20 deaths sorted by death-die-date but it sorts by day – so all the 31. are ahead then 30. 29. and so on … can you help me?
Field-Settings:
http://fs5.directupload.net/images/161005/2closraw.jpg
Frontend:
http://fs5.directupload.net/images/161005/m2l4lwy4.jpg
Is the format for dates you used the way they were stored on the old site?
In order to sort dates they need to be in either be timestamps or in a YYYY-MM-DD or YYYYMMDD format (year, month, day). This is they way that ACF stores dates and if you want to sort by them then you’ll need to find a way to convert them to a sort-able format.