Looper Provider: Order by custom field?

Hi,

We have a custom post type with custom fields for events - this is made in toolset. We are using the looper and it is working great. One thing is It appears we can only order by preset WP fields. is there any way to customize this so we may order by our custom event start date field?

Thank you!

Hi Michael,

Thanks for reaching out!

If you want to order your post type by ACF custom field, this can be done using the Query String as Looper Provider. See an example below.

image
post_type=post&orderby=meta_value&meta_key=date_field&order=ASC

See the corresponding field below.

post_type = name of your post type
meta_key = is the name of your date field, for example the key name of my date field is date_field
order = ASC or DESC

I already tried this on my development area and it is working great.

Hope that helps.

Thank you.

Indeed and works great with Toolset as well!! Thanks!

Hi Michael,

Glad that we are able to help you.

Thanks

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