Skip to content

Add ability to omit the current post from a Query Loop's posts #42810

@Humanify-nl

Description

@Humanify-nl

What problem does this address?

I think it is a very common practice to add query loops in the bottom of a single template to show ‘other/related posts’. This is currently not possible with the block.

What is your proposed solution?

In the classic approach, we could use the query argument to remove the current postID (with get_the_id) (I used this as a default for all queries).

This works because we very rarely have cases where the post(-type) or page query should include itself in the loop (correct me if I’m wrong).

Can we do this for the query-loop block? It would enable ‘related posts’ lists under any page, while omitting the post currently on screen. Without having to add another filter arg in the block settings.

Metadata

Metadata

Assignees

Labels

Projects

Status

🦵 Punted to 6.9

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions