
List YARPP block in Gutenberg editor.
Displays YARPP related posts with the native Query Loop block. YARPP only provides the related post IDs, rendering is done by core blocks like Post Template, Post Featured Image and Post Title, so the layout can be styled in the Site Editor.
The legacy List YARPP block is still included for existing sites.
This block requires the YARPP plugin and relies on the yarpp_get_related() function.
Insert the YARPP Related Posts variation of the Query Loop block, or add these optional keys to the query attribute of any Query Loop block:
"related": "yarpp" – Shows the YARPP related posts of the current post in YARPP order."excludeCurrent": true – Excludes the currently viewed post."excludeDisplayed": true – Excludes posts already shown by Query Loops rendered earlier on the same page."requireThumbnail": true – Only shows posts with a featured image."hideEmpty": true – Hides the whole Query Loop, including headings inside it, if no posts are found."minPosts": 3 – Hides the whole Query Loop if fewer posts are found. Posts of a hidden Query Loop are not excluded by excludeDisplayed.Example: related posts followed by the latest posts without duplicates.
<!-- wp:query {"queryId":1,"query":{"perPage":3,"postType":"post","inherit":false,"related":"yarpp","excludeCurrent":true,"minPosts":3}} -->
<!-- wp:query {"queryId":2,"query":{"perPage":3,"postType":"post","inherit":false,"excludeCurrent":true,"excludeDisplayed":true}} -->
The editor preview shows regular posts; the related posts are applied on the frontend.