Feat: Add “Show related posts” toggle & "same term" filter/flag to display related posts.#77125
Feat: Add “Show related posts” toggle & "same term" filter/flag to display related posts.#77125sarthaknagoshe2002 wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Closes #77099
Adds a “Show related posts” toggle to display posts sharing the same categories/tags as the current post.
Why?
This is a longstanding gap for theme authors. The most common use case is a “Related Posts” section at the bottom of a single post. Today, the Query Loop block requires selecting explicit terms and has no awareness of the current post’s terms.
How?
Added a toggle labeled “Show related posts” for same-term filtering.
Uses core-data to fetch the current post’s categories/tags dynamically.
Automatically update the block query when terms change.
Testing Instructions
The Theme authors can use
__experimentalSameTermflag to enable this feature.Screenshots or screencast