I am trying to: I have a post type called authors, another one called publications and another one called publication-authors witch is children of authors and publications. Actualy in the authors content template I have a view displaying the publications of each author (publication author) and I want to sort these publications with a publications post field called publishing date
I have already done that but it doesn't work. The fact is that Publising date is a custom field that belong to one of the parents and doesn't concur with the post date.
I have a filter that filters publications by "Select posts that are children of the Post where this View is shown". But if I change that I can't display publications that belong to one author.
I have to filter the author-publication by author and then sort them by the custom field "Publishing date" of the parent post type "publications"
It seems I need a visual example to understand the setup correctly.
But from what I gather, the view that you want to sort does not have the publishing date custom field correct?
This is because you mentioned that the custom post type being displayed by the view actually has the published date on the parent post.
The view can only sort by custom fields on the current posts that it displays. Why not move the published date custom field to the child instead of having it on the parent?
If it remains on the parent then we are not able to sort it by this field.
Yes you are correct.
Is there any way I can copy the custom field of the parent in the child automatically? I mean, I have a lot of publications and a lot of authors. Could I copy the custom field "publishing date" (of the parent publications) to the children (publication-authors) and get the values that it has?
The only way i can see you sorting the child posts and this doesn't meant that they will that they will be in order of the time each child post was created.
This means that they will be in order of which the Parent is displayed.
What you can do is to create a view in a view setup and have the parent view display the child view. This way you can sort the parent view by published date and the child posts will display based on the order you set the view to display the published date.
I have been trying and it doesn't work. I have created a view that displays the publications by the publishig date(called prueba), then I have displayed this view in another view that displays publication-author, called publications (child of publications and author). The view called publications has a query filter "Select posts that are children of the Post where this View is shown" because it is inside of a content template of authors. this way I can display only the publications that belongs to one author but I cant sort them with the view prueba, it doesnt work. I attach images of the code.
Because of that line there are duplications because you are displaying the post title of another post type. So if multiple posts from Publication authors have the same parent then it is going to show the same title multiple times.