Support

Account

Home Forums Gutenberg Using Relationship field in Query Loop

Unread

Using Relationship field in Query Loop

  • I have two related custom post types (STORIES and CONTRIBUTORS) and have used a Relationship field to connect them together – so you can go into each story and selecting a number of contributors.

    Question: How best to show the CONTRIBUTORS related to a STORY on the front-end?

    The core Query Loop block does almost everything, but it can’t filter based on that relationship field – i.e. show just the CONTRIBUTORS that have been associated with that particular STORY.

    How would I go about doing this? Is a block variation of the Query Loop the way to go?

    Ideally I want to create an html template for the STORY post type and include this as part of it so that the user simply creates their story content and associates several CONTRIBUTORS to the post and it dynamically shows the correct ones on the front-end.

    Any assistance much appreciated.
    Jamie

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.