Skip Navigation

[Resolved] Overcoming a big with date-based filtering.

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have a table called "Top Fires" on my homepage using Toolset. The data sorts correctly when clicking on most headers, but the date-based columns ("Date created" and "Date modified") do not sort properly and seem to sort randomly.

Solution:

Change the code for the headers of the date-based columns. Use the "types-field-" prefix for the custom fields in the wpv-heading shortcode:

<th>[wpv-heading name="types-field-created-on"]Detected[/wpv-heading]</th>
<th>[wpv-heading name="types-field-last-updated"]last updated[/wpv-heading]</th>

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-heading

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.

This topic contains 15 replies, has 2 voices.

Last updated by Christopher Amirian 6 months, 3 weeks ago.

Assisted by: Christopher Amirian.

Author
Posts
#2707015

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I have an answer from the second tier support. Please change the code you used for the header of the table from:

  <th>[wpv-heading name="types-created-on"]Detected[/wpv-heading]</th>
   <th>[wpv-heading name="types-last-updated"]last updated[/wpv-heading]</th>

to:

<th>[wpv-heading name="types-field-created-on"]Detected[/wpv-heading]</th>
  <th>[wpv-heading name="types-field-last-updated"]last updated[/wpv-heading]</th>

For the wpv-heading shortcode you need to have the "types-field-" prefix for the custom fields. Here is the documentation about that:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-heading

Thanks.