Ordering posts by historical dates (B.C. and A.D.)
-
I’d like to automatically place events recorded in a special post-type on a timeline, ordering them from the oldest to the most recent.
Given that the ACF Date Picker only goes back to 1927, at least over here, I created an ACF custom field called “acf_year” as a number type, and the following code:
[loop type=timeline orderby=acf_year] <div class="milestone"> <div class="milestone_title">[field title]</div> <div class="milestone_text">[field acf_milestone] <a href="[field acf_milestone_source]">[+]</a></div> </div> <div class="line"></div> <div class="milestone_year">[field acf_year]</div> [/loop]
It works (mostly) fine. For some reason, a number like 811 is not placed before 1200, but from 1000 on, the events are ordered correctly.
However, that’s not my main problem.My main problem is that certain dates are B.C. Can I use CCS to order from the oldest B.C. date to the most recent A.D. date?
I thought about doing some operations with [CALC] but I cannot display a negative number in the timeline.
Any idea would be greatly appreciated. Thanks
- The topic ‘Ordering posts by historical dates (B.C. and A.D.)’ is closed to new replies.