Looper: Custom Post Type Sort by Custom Field

Hey there,

I am trying to sort the output of a looper from custom field.

I’ve found this thread: Looper Custom Post Type Sort by Custom Field

Basically that is what I want but I’m having trouble to get it to work since my custom field is “date time” and I’m not sure how to write the string so right now it’s outputs the data but the sorting is not working.

This is the string I have:
post_type=bands&orderby=meta_value_num&meta_type=DATETIME&meta_key=timeslot&order=asc&posts_per_page=0

Could you help me out here? I’m not sure of how these parameters really work…

Hello @PhilTone,

Thanks for writing in!

I think you will need to add orderby=date in your query string. For more details about Order and OrderBy parameters in a query, please check this out:

Best Regards.

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