Support

Account

Home Forums General Issues Exclude Relationship posts from loop

Solving

Exclude Relationship posts from loop

  • On my category posts I am using the Relationship field to give the ability to hand pick 4 featured articles. Then, further down in the post, I am using the post loop to find the 4 most recent posts. Requirements state that the Relationship posts cannot be in the recent posts loop. How can I exclude them?

  • Hi @amanda-lee,

    The two are in separate loops and thus it would be tricky to check the posts that are within the Relationship loop.

    You can however create some logic to check the post_ids of the posts in the get_field() call and then use the ‘exclude’ parameter in your query to remove these posts.

  • Hi there, Did you solved this? i need the same thing 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Exclude Relationship posts from loop’ is closed to new replies.