Problem:
I have a custom post type 'content-panels' that has a many-to-many relationship with Pages.
I would like the order of the Content Panels to be different on a page-by-page basis, so I have created a numeric custom field ('position-of-content-panel-on-page') that is associated with the intermediary post type: 'content-panel-page'.
I have successfully set the order number for the Content Panels (different for each page). The problem I have is that I need Views to output the Content Panels in the order dictated by the same intermediate custom field.
Solution:
You need to setup a post view:
- Query posts of intermediary post type 'content-panel-page'
- Order the results by custom field 'position-of-content-panel-on-page'
- Filter by post type relationship between 'content-panels' and 'Pages'.
- In view's loop, display related "Content Panels" post information
Relevant Documentation:
https://toolset.com/course-lesson/displaying-related-posts/#displaying-one-related-item-parent