• I’d like to extend the Query block such that the same post will not be displayed multiple times, where multiple Query blocks are inserted in the same page/template.

    The linked site’s homepage uses a Classic theme. The top section of the homepage features recent posts in particular post categories. Even when the same category is assigned to multiple “slots’ in this top section, the same post will not appear more than once. Additionally, none of the post featured in the top section will appear in the bottom section.

    I was able to achieve this in the site’s Classic theme by maintaining a running list of all the posts previously displayed in the top section, and modifying the multiple query loops in the page’s PHP template to feed this list as an array into each query, as an exclusion.

    Can the same thing be achieved in an FSE theme using the an extended version of the Query block, and if so, what would be the steps required to achieve this?

    I’m not necessarily looking for details and example code at this stage, just need to know if it’s possible to achieve this at all, and where I might start, if so.

    I’m looking to create a new FSE theme for the site, and I think I can make it do everything I need using just stock WP blocks, apart from this one key feature of the old theme.

    Any tips greatly appreciated!

    The page I need help with: [log in to see the link]

  • You must be logged in to reply to this topic.