display a list of pages and custom posts on a page, which is a parent to these pages and custom posts.
I created a view with a content selection of "Page" and "Post Series" (my custom post type) and a Query Filter, which selects all the children of the current page.
The pages and the post series are hierarchical and the parent is set to "Islands". in the custom post type Pages are set as parents and Posts are set as children. In the "Fuerteventura" custom post the parent page is set to be "Islands", which is a page.
Link to a page where the issue can be seen:
hidden link
I expected to see:
All the custom posts and pages should be shown in the sidebar (which is not the page sidebar, but a column in a toolset layout). Each entry consists of a featured image and the Title of the page or custom post.
Instead, I got:
Only the child pages are shown (Rügen). There is also a child custom post about Fuerteventura, which has this page as a parent, but it is not shown.
I attached screenshots of the Post Relationship in the Definition of the custom type Post Series and the end of the configuration of the Post Series Instance "Fuerteventura", which shows, that page "Islands" is set as parent.
Then there is the view "List Pages" with the query filter (screenshot20) and the loop:
Ok - you are using wrong filter. You should delete the current query filter and try to add the "post relationship filter" when you click on button "Add a filter" and from drop-down select box - select the "Post relationship filter" and add it and then select the option "Post where this View is shown" and save the filter or chose your desired option that matches your requirement.
Yes, this works and I have tried it before, but it only shows the custom posts, while the other filter only shows the pages. What I need is both. I have created 2 views now and everything displays, but it is not sorted (I do not want to make any distinction between the pages and the custom posts in the list, so it should be just one sorted list).
It would work, if I could use both filters with OR, but the filters are combined with AND. So I do not get any result, if I use both filters in one view. Can you think of any solution for this?
Yes - I think I've solution for that but I need to check first - I would like to know how you are adding both filters?
Could you please setup both filters and send me access details and tell me which view you are using.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
I tried to change the FTP password or create a temporary extra account, but it is not possible and I do not want to mess with it too much. So I cannot give you FTP access.
Also I would like to change this to an enhancement request: As there is support to set up a hierarchy of pages and custom posts, there should also be a possibility to use this consistently within toolset without having to do any PHP hacks.
What I would expect is a single filter, that works on page and custom post hierarchies in the same way, so I can create a single view displaying all children of a specific page, regardless of the type of the child (page or custom post). They all have the same page as a parent, so it should be able to display them together in any chosen sort order.
What I would expect is a single filter, that works on page and custom post hierarchies in the same way, so I can create a single view displaying all children of a specific page, regardless of the type of the child (page or custom post). They all have the same page as a parent, so it should be able to display them together in any chosen sort order.
==> Well - this is not actually possible with single filter as there is no automatic way to identify that you are queering page or posts or both. So there is two possibilities as I explain you before that either you should have different view for your both post type (page and post) or you need to add filter using view's hook where we can do amendments with passed arguments on fly.
I do not really understand, why you can do it with PHP and not with Toolset, which would use the same programming language. So it is just a feature, which is currently not implemented and the current solution is not very consistent (custom posts and pages can all be children of pages and so it should be possible to query all children of a certain page, whatever type they are). Having two different filters for the same thing is not logical and not a good way to do it anyway.
Let's close this and I will make an extra feature/enhancement request for this.