gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Query Loop Block: Adding Multiple Query Loop Blocks with the option to not repeat posts already shown by previous Query Loop on same page

Open filipanoscampos opened this issue 4 years ago • 8 comments

What problem does this address?

I have recently been playing around a lot with FSE and the Query Loop Block and became somewhat frustrated when trying to go wilder and add more than one Query loop Block to show my posts with different styles.

What is your proposed solution?

At the moment we can add multiple Query Loop Blocks and style them separately but, if they all follow the same settings, they will show the same posts.

It would be interesting if there was an option to not repeat posts that are already shown by previously added Query Loop Blocks.

This is possible for example, with the Post Carousel Block and the Blog Post Block, which never show repeated posts.

Yet, in the case of the Query Loop, I believe it would make sense to have this set up as an option.

This would allow users to create more adventurous styles for their websites. For example, I built this example by manually choosing settings until I got the desired result:

Screenshot 2022-05-07 at 12 44 50

Which isn't a practical approach for websites with a large number of posts.

filipanoscampos avatar May 07 '22 11:05 filipanoscampos

As part of the nineteenth call for testing for the FSE Outreach Program, the following related feedback came in that touches on the problem described above when using the "offset" pattern bundled with the query loop:

Chose the last pattern (alternating 2 column, didn’t get to see the name if there was one). Removed the default “Hello World” post which has no image. Modified the first column featured images to use a b/w duotone and added a post excerpt under the post date. Saved. Viewing the page lists duplicate posts for his pattern. https://i.imgur.com/B9JeWO0.png

It makes me wonder if we should remove this offset pattern until the above is resolved!

annezazu avatar Dec 22 '22 04:12 annezazu

This would also be helpful for sites with a lot of content that use query loops to surface posts from different types of queries (latest, taxonomy terms, etc). The alternative is a fragile approach to offset various queries to attempt to skip posts displayed by previous queries. But that falls apart quickly when mixing different terms and taxonomies with varying degrees of overlap.

celloexpressions avatar Apr 01 '23 20:04 celloexpressions

To add to this, it would be great if a Query Loop Block on the Single Post template could exclude the post that is currently being viewed from appearing in the Query Loop. This feature was requested by a WordPress.com customer.

masperber avatar Aug 14 '23 22:08 masperber

+1

cagrimmett avatar Oct 09 '23 18:10 cagrimmett

No progress made on this front. Punting from 6.5!

annezazu avatar Jan 29 '24 16:01 annezazu

Also struggling with this issue as I'd like to 1) use different styles/attributes for the first query result 2) insert content in the middle of the query loop list and 3) include paging. My "solution" was to run the main query three times and hide sections of the list via css, but obviously this is not ideal.

jethin avatar Feb 21 '24 15:02 jethin

Hi folks, We are only one week away from the Beta 1 cut-off date for WordPress 6.6. This issue hasn’t seen any movement in a while, so we (the editor triage leads of the 6.6 release) have decided to remove it from the WordPress 6.6 Editor Tasks project board.

colorful-tones avatar May 22 '24 18:05 colorful-tones

If it's at all helpful there's an attempt at resolving this in the https://github.com/humanmade/hm-query-loop plugin. It also adds deduplication of queryId and support for multiple post templates within a single query loop so you can split posts into different layouts.

roborourke avatar Jul 16 '26 09:07 roborourke