[Resolved] Trying to sort using two different fields in created post type
This support ticket is created 5 years 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have created a Post Type called Newsletters.
I have two custom fields in the Newsletters type:
1. Display order sort - Number (required). This is the sort order for the Newsletter editor to indicate the displayed post order (ascending).
2. Quarterly select - Select (required). This is the overall grouping for each Newsletter post. They are grouped by season and year (i.e.: Spring 2019, Summer 2019, etc.). They are to be displayed descending by and have display listed as a header.
I have attempted to create a View within a View that will list the posts as follows:
Winter 2019
* Post Winter #1
* Post Winter #2
Spring 2019
* Post Spring #1
* Post Spring #2
* and so on ...
The results I get either list the Quarterly Select over each post: (hidden link)
Winter 2019
* Post Winter #1
Winter 2019
* Post Winter #2
Spring 2019
* Post Spring #1
Spring 2019
* Post Spring #2
... or all the posts under each Quarterly select: (hidden link)
Winter 2019
* Post Winter #1
* Post Winter #2
* Post Spring #1
* Post Spring #2
Winter 2019
* Post Winter #1
* Post Winter #2
* Post Spring #1
* Post Spring #2
Spring 2019
* Post Winter #1
* Post Winter #2
* Post Spring #1
* Post Spring #2
Spring 2019
* Post Winter #1
* Post Winter #2
* Post Spring #1
* Post Spring #2
Hello. Thank you for contacting the Toolset support.
The issue here is your structure as you want to group the posts with a specific entity, in your case Quarterly select.
To group such items, the easiest way is you should add custom taxonomy instead of the custom select field "Quarterly select". You should create custom taxonomy and add all the options you added to Quarterly select field as terms. And delete the custom field "Quarterly select" as we are going to use the taxonomy, not the custom field.
Once you create a taxonomy and added the terms assign the term to your posts and then create a taxonomy view and inside the taxonomy view you should add your post view.
Still can't figure it out. Not able to sort the two Views correctly, even though I've replaced the Quarterly Select with a custom taxonomy. Login is still live.