-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query Loop block: Allow creating loop to display child pages #54461
Comments
+1 |
+1 for this need My suggestion is to add some kind of option to the parents field of the query block. |
I'm not sure if the following thing has been implemented over the years, but, I don't think we need to set an ID within the Screen.Recording.2025-01-23.at.12.12.45.PM.movI think we can already display the children of a
I'd be happy to work on this enhancement. |
My goal with this feature is to be able to create templates for CPTs that contains a query to list child posts. As templates as HTML It's not possible to use PHP to dynamically set the current ID. I guess it's a two step process. 1. Make it work from the template. 2. Add editor UI. Otherwise it breaks if a website owner wants to edit a template containing the feature. |
Just been digging around in a client project and noticed there is an If we can add a keyword/"magic word" way to implement the adding of the current post to the parents array, the same could be reused to improve the |
You are right! I've tested it now and it works. It is possible that I was confused in the past about what should I set the field to. I've tried adding page ID numbers. So it seems the issue is UX related. Maybe some description text for the field could do the job? Something like "Start typing the title of the parent item" could help? On my development server I have almost 3 seconds delay even when I start typing the parent page title before any results are shown, so that could cause my initial confusion that the field does not work. But I can confirm now, displaying child pages query does work using this method.
This would be a great enhancement to have! I'm all for that. And I think it could resolve @Drivingralle's issue too. |
My goal is to set the query inside a template to always query the children - no matter the name. |
@Mamaduka Can I be assigned this ticket please? Thanks! |
What problem does this address?
In one of my pages - it is a parent page that has nested/child pages - I'm trying to add a Query Loop block displaying the list of child pages. I can not seem to do so.
Here is how to reproduce:
Here is what I try to set for the Query Loop block used in "Parent page":
The loop does not display the child pages, it simply displays a list of all pages of the website.
What is your proposed solution?
The text was updated successfully, but these errors were encountered: