-
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
Adding more filters to query block #31390
Comments
I can think of two things that in my opinion should be possible to do with Query Blocks. #1 Ability to select multiple specific posts to make a list of posts that is not based on post type or categories. Maybe have an "Custom list" option in the "Post type" dropdown of Query Block settings pane. And after selecting it the author can then add any posts to the list either by searching or specifying title/slug/id. #2 Ability to use a custom query which will be defined outside of editor where one could code any query desired. One solution that I have seen for this is by using action hooks. For example, lets say we want to get all posts that have a featured image. This is how it could look like:
Then, in the settings pane of a Query Block we could specify our custom query name which in this case would be EDIT: |
It would be great to have a way to select specific pages (CPT=Page) to display in this block. |
It would be very helpful to include:
|
The lack of ability to filter by more specific criteria really limits the usefulness of this block. |
Several of these features mentioned in here have been implemented:
|
In addition to @mrfoxtalbot's suggestion for filtering "child of x" pages, it'd be really cool if we could query top level pages. I'm working on a project where we're creating a knowledge-base, and being able to have robust page hierarchy options would make it a lot easier to drill down topics using static pages. As it is, I'm having to build things out as posts instead—which isn't that big of a deal, but it wasn't our first choice. |
There's a Pull request for this feature - #40933 ; you can try it (on a local/testing website, because there may be small bugs!) by downloading the zip at the directions at #40483 (comment) |
👋 - after reading the extending Query Loop docs, do you think we can close this issue? If not can you pinpoint the specifics that are needed and check if there are existing issues or update this one? Thanks! |
Now the Query loop block can be customized and extended |
I am trying to use the query block, and I think it could be useful to find a way to filter the query by more fields.
I.e. I am trying to filter page-type posts, and I'd like to chose which to show, by a custom filter.
I have seen a page builder has an option in filtering, passing a custom string that is a filter name created in the theme.
In this way, posts can be filtered by custom fields too.
The text was updated successfully, but these errors were encountered: