I have successfully created many-to-many relationships and I can display the relationships using a View and order by Title, Post Date, etc.
However, I need the related posts in any relationship to be displayed in a specific order.
To do this I created a numerical custom field in the post relationship (see Screenshot 1) and entered a numerical value in this field. For post A it is 1 and for Post B it it is 2, and so on (see Screenshot 2).
I then set up the view to order the results based on this field (see Screenshot 3).
However, no posts are being displayed - i.e. no items are found by the view.
Ah yes - it's not an archive view, just a regular view.
The field is on the intermediary CPT (although not entirely sure whether I set up the Relationships with an intermediary CPT or not as you had the option not to - and couldn't see why the option was there to not have an intermediary CPT?)
So.... because it's on the intermediary CPT and not on the post type itself, it can't find it to sort...?
What you would need to do is to do is to create a nested view setup with the Intermediary CPT being the Parent view and the child view being the one you want to sort.
Then all you need to do is sort the Intermediary CPT view by the custom field and then add the Child view to that view and the child view should list out the content based on what the order of the Parent view is.
Also you will need to add the Post Parent query filter to the child view so that it will list out the correct children based on the Parent view.
That makes sense... but the Intermediary view is not visible in the admin panel and I can't seem to go back into the existing Relationship and make it visible?
I've set up a (parent) view that will display the intermediary CPT. This is sorted based on the custom field. Does this parent view need to also have this filter on it "Select posts whose parent is the page where the View is shown."?
Then the (child view) will display the CPTs. Will this also need to have the filter "Select posts whose parent is the page where the View is shown."?
You can edit the visibility settings of your CPT by going to Toolsets -> Post Types and from here you should be able to set your CPT to be shown, enable publicly_queryable setting and it should show up in views.
In my example I have two CPTs - SOUNDS and SEQUENCES.
I have set up a many-to-many relationship between SOUNDS and SEQUENCES with an intermediary CPT called SOUNDS TO SEQUENCES.
I have set up a custom numerical field in the intermediary SOUNDS TO SEQUENCES so I can add a custom display order to each relationship.
So... for example SEQUENCE '002' is linked to SOUND '230' and SOUND '252'. I have edited the custom fields so the first SOUNDS TO SEQUENCES custom field is 1 and the second is 2. (see screenshot6)
On a single SEQUENCE page I want to display the SOUNDS in the order based on the custom field.
To do this...
I set up a parent view that displays SOUNDS to SEQUENCES . It is ordered by the custom field and also filtered by posts in any relationship with the post where the view is shown (i.e. a single SEQUENCE such as SEQUENCE '002'). (see screenshot4)
In the loop for the parent view I have nested child view that displays SOUNDS (it matters not what order) and filtered by selecting posts whose parent is the page where the View is shown. (see screenshot5).
However, I get this warning " This will filter out posts of the following types, because they are not hierarchical: Sounds"