Showing current category posts in “recent posts”-block
-
Hi there,
For my website I use a FSE/blcok theme, where I created all my templates with the standard Gutenberg blocks. Now I am struggling with something related to my template for single blog posts.
At the end of each post I use the Query Loop to automatically show the 3 most recent posts.
The problem is, I use this template for all my blog posts and ideally I want the query loop to only show the 3 most recent posts from the same category as the post you are viewing. So for instance, if you read a post that’s part of the Producitivity category, then you would only see the 3 latest posts from that same category.
I know that when you add the query loop block, you can select a category in the block settings. However, that then applies to all the posts – also to the ones within different categories.
So the question is; is there a way that the query loop automatically only shows posts from the same category as the current post?
I am not very good with coding, so I really hope someone can help me with this.
Thanks in advance!!
The page I need help with: [log in to see the link]
The topic ‘Showing current category posts in “recent posts”-block’ is closed to new replies.