Tell us what you are trying to do?
A many to many relationship seems to be too awkward for a site I'm redeveloping.
Is there any documentation that you are following?
All the documentation on Types post relationships.
What is the link to your site?
hidden link
I'm redesigning a site, and I want to simplify everything.
For the old site, I had set up a one-to-many CPT "Photo Competitions" (parent) with "Competition Entries" (children).
Users create Entries via a front-end form.
Everything works fine... EXCEPT:
Once a year, they have a "Year End Competition"
This Competition consists of the best (existing!) entries from the whole year.
Since Competitions are one-to-many, I had to write custom queries and add special categories in order to display the results, and I could not use my Competition templates or views, and sorting by score was a big problem.
On the new site, I thought I would change it to a many-to-many relationship, so that I could connect the entries with multiple parents (Regular Competition AND Year End Competition). This way I could use the same views/templates for everything.
It started out okay, but now I'm finding that I can't assign a parent via the front end form when the user adds a new entry, even though the form is on the parent page, and I know its ID. =( I can't use "@competition-entry.parent" on a many-to-many. Tried "competition-entry.association", but got errors. Tried a post reference field, but that didn't work, either.
It seems like the DEFAULT behavior should be to assign the current parent if the form is submitted from a parent page, then you can edit the relationship later with a relationship form or in admin if you choose to.
I understand that I can set up a CRED relationship form and do it in another step, but the users aren't too bright, and it would be difficult to get them to do this... and I'm trying to SIMPLIFY the site.
It seems silly to have to go through this for a once-a-year competition when everything else works fine with a one-to-many relationship.
Can I somehow use additional custom fields, shortcodes, custom functions (CRED save data?), or a custom intermediary post type to do this?