Title: Custom date field sorting bug?
Last modified: September 8, 2018

---

# Custom date field sorting bug?

 *  Resolved [iantresman](https://wordpress.org/support/users/iantresman/)
 * (@iantresman)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/custom-date-field-sorting-bug/)
 * Am developing a site which uses a Toolset Types date field (wpcf-date). CCS correctly
   displays the field ([link](https://dev.sandbach-concert-series.co.uk/)), but 
   does not order them correctly. The last upcoming event should be shown in April,
   suggesting the ordering is carried out on the published date field? Here is my
   shortcode block:
 * [raw]<div class=”eventscoming”>
    [loop type=event count=12 field=wpcf-date value
   =future-time in=timestamp order=asc offset=1] <div class=”eventbox”> <h3>[field
   title-link]</h3> <date>[field wpcf-date in=timestamp date_format=”D j M Y @ g:
   ia”]</date> <div class=”eventimage”>[field image-link size=medium]</div> [link
   url]More…[/link] </div> [/loop] </div>[/raw]

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Peter Berger](https://wordpress.org/support/users/peterpolow/)
 * (@peterpolow)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/custom-date-field-sorting-bug/#post-10670044)
 * Would you try to add `orderby=field_num` to the loop code?
 * I hope it works!
 * Peter
 *  Thread Starter [iantresman](https://wordpress.org/support/users/iantresman/)
 * (@iantresman)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/custom-date-field-sorting-bug/#post-10670060)
 * Genius, thank you!
 *  [Peter Berger](https://wordpress.org/support/users/peterpolow/)
 * (@peterpolow)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/custom-date-field-sorting-bug/#post-10670068)
 * You’re welcome. Don’t forget to mark this as resolved.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom date field sorting bug?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Peter Berger](https://wordpress.org/support/users/peterpolow/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/custom-date-field-sorting-bug/#post-10670068)
 * Status: resolved