Default Sorting feature not working

Hi

I have set up Default Sorting to a custom list attribute which is of Date type.
I am setting the value of the custom date on the back end as update_post_meta($listing_id, ‘hp_sort_date’, current_time(‘mysql’));

However on the listing page where that custom Date is selected to be the default sorting I do not see the lists showing as they should, namely it seems that the time is not taken into account.

When i sort the list in the database it shows the listing as it should

SELECT p.*, pm.meta_value AS hp_sort_date FROM wp4z_posts p LEFT JOIN wp4z_postmeta pm ON p.ID = pm.post_id AND pm.meta_key = 'hp_sort_date' WHERE p.post_type = 'hp_listing' ORDER BY pm.meta_value DESC;

Also important, after applying the filter to filter out some listings they show with the default post_date sorting, not the custom one that was set up

Hi,

We checked this issue from our side, and it seems okay. Please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.

If this issue exists, please provide more details (e.g., your actions step by step with screenshots, etc.). This will help us to reproduce and resolve the issue faster.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.