Support

Account

Home Forums Gutenberg Exclude which post to show in a query that is displayed multiple times on a page

Unread

Exclude which post to show in a query that is displayed multiple times on a page

  • I have a ACF Gutenberg block with several options

    – Display latest posts, lets say 5
    – Display selected posts, is a list of posts from which I can select which to show.
    If I add this block several times on a page, with the option to select the posts which I want, I don’t want the posts from this block to be shown also in the block with the latest posts.

    How can I make the query for the block with the related posts to exclude the posts from all other blocks ?

    I tried parse_blocks( $post->post_content ) but it display’s a big object from which my block is maybe at the 10’th indentation.

    I tried to store the post->ID of the posts in the option database with the page-id as key, but the last block will overwrite the stored values.

    Any ideas will be much appreciated. Thank you.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.