I'm building a 'my account' page with some complex functionality, and struggle with finding a way to display the parent post of another post type.
More specifically:
The user is first asked to create a single 'member profile' (post type) to be displayed on the website. I have done this by creating a view limited to show only one 'member profile' - and if there are none submitted yet, then it displays a form for creating it.
Once they have created this, they are shown this member profile (I've designed a preview using content templates).
So far so good. Now the second step is for them to create a project.
Each project can have multiple team members. I've created this as a many-to-many relationship, since some members could potentially belong in several projects (though, this would be done in exceptional cases - I'm not designing the front-end so that users can do this themselves).
Users are now provided two options - they can either use a relationship form to connect their profile to an existing project (one already uploaded) or they can create a project for their team (when this does not yet exist).
I have been able to create both these forms, and currently display them when there are no projects found. The challenge is, however, that I cannot figure out how to display the project that is connected to their member profile! I could, of course, show the project that the user have created themselves - but that would not display this project for members that have used the relationship form to connect to an existing project.
I've tried to 'nest' the view for projects within the 'member profile' view, at the bottom of the content template for the user profile preview in the view - but it does not work to choose to display projects related to "projects in the loop" (probably because it is essentially a view within a view).
Apologies for the long message, its a bit tricky to explain. Any pointers would be really helpful! To summarise: I am trying to create a view that would display projects in any relationship to the currently logged in users 'member profile'. I cannot use post author query, since some team members connect to existing projects.