Skip Navigation

[Resolved] Sorting on custom posts display is acting like a filter instead of a sort

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

Problem:

The problem here is that the user's backend sort is behaving like a filter for their posts

Solution:

It should be noted that any backend sort is handled by the wordpress API which doesn't involve our Toolset Plugins.

However in this user's case they were sorting by a field that had empty values on some posts.

This is why some of the posts where not showing up as you're not able to sort a null value.

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by ChuckGregory 3 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#2121305
e posts list sorted by is-template.png
e posts list.jpg

I am trying to: stick posts with the 'is template' field set to the top of the list

Link to a page where the issue can be seen: hidden link

I expected to see: all the 'e' posts, with the 'Template' ones at the top

Instead, I got: just the 'Template' posts

#2121435

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Chuck,

Thank you for contacting our Support forum.

I see the problem here, also I should mention that these options here are completely controlled by WordPress core and is not a Toolset Issue.

However the problem you are having is that some of your Posts dont have the "Template" value assigned so when they are sorted wordpress will only return the items that have that value.

Empty values cannot be sorted.

I hope I was able to provide some clarity on the issue here for you.

Thanks,
Shane

#2123183

My issue is resolved now. Thank you!

But: I suspected that was the issue. I solved it by exporting all of the posts to csv, setting that field for all, and then reimporting them. Was there an easier way, perhaps in the definition of the custom field? It's not clear to me exactly how the 'store in database' stuff works when adding a custom field. Is there a way to populate it for previously existing posts?