For those not familiar with how WordPress works under the hood, The Query block (and its friends Query Loop and Query Pagination) can be tricky to understand. Attaining this knowledge shouldn’t really be a requirement to do something simple like display some posts from a category on a page that you’re creating.
The existing Posts List block helps with discovery, but upon insertion users are still faced with the Query and it’s associated complexities:
The experience is especially bad at the moment, because options like “inherit query from URL” are practically useless in the context of editing a post or page, and Query Pagination doesn’t work at all.
Today I explored how we might extend the Posts List variation so that it feels more like a unique block that stands by itself, and obfuscates some of the complexity of the underlying Query. The concepts are described in the video below:
Summary of changes
Here’s what changed:
- “Posts List” renamed simply to “Posts”
- Query Loop block is hidden in the UI
- Post type selector is removed
- “Offset” and “Include sticky posts” options moved to “Advanced” panel
- Confusing “inherit query from URL” setting is hidden
- Filtering options tidied up
- Layout and ordering options tidied up (icons need some attention)
This is my first take on this block, so changes will no doubt be forthcoming. You can follow along on https://github.com/WordPress/gutenberg/issues/32268
Leave a Reply