Skip Navigation

[Resolved] sorting based on limited multiple taxonomies

This support ticket is created 5 years, 2 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1374211

I made a custom post type, "events" and seven taxonomies that break down events into different event types.

I trying to make a view that displays, in chronological order, the next upcoming event of each of the event types, but limited to only one of each event type.

for example: hypothetically, if my event types were, sporting events, family friendly events, pet friendly events, and free events. I would like to display:

Nov. 1
pet friendly event

Nov 2.
family friendly event

Nov. 2.
free event

Nov. 25
sporting event

#1374245

Hello, unfortunately there's nothing exactly like this built in to Types. You can filter by a custom field start date and order by start date, but not when you only consider the first result from a specific category in the query. I think you would have to use custom code to get this to work exactly like you want. We offer the API get_view_query_results that will allow you to access the results of a View in PHP:
https://toolset.com/documentation/programmer-reference/views-api/#get_view_query_results
You could call that API multiple times to get the results for each category, then combine those post IDs into a comma-separated list. Then feed that comma-separated list into another View filtered by post ID. That's probably the most straightforward way I can think of to achieve this exact display.