ACF relationship field returning post id number

Hi

Using ACF i have created 3 custom post types Events, Artists and Venues. The aim is to have an Events archive page that pulls the venue details and the artist details from the relevant posts. As can be seein the screen shot i can display the evnt title date and time but the relationship fields are displaying the post ID number. In my head i know i need to use this number to retrieve all the information in the post and then pull out the relevant information but i seem to be missing something. Can you please point me in the right direction.

many thanks for any help

Hello @The_Capture_Factory,

Thank you for the inquiry.

You can either create a Looper Provider > Query String with the parameter “?post_type=your_post_type&p=123”, where “p” is the ID of the post and “post_type” should be either “artist” or “venue”, or create a Twig template using the get_post function.

Example:

{% set venue = get_post({{ ID_HERE }}) %} {{ venue.address }}

This should help: https://theme.co/docs/twig

Let us know if you need more info.

Best regards.

Hi

Thanks for pointing me in the right direction your information has been a great help. I have it up and running as well as accessing an array field of an ACF Google location field with the help from this post ACF & Google Map

I would love to have gone down the twig route but i am going to need a little more guidance on building twig templates that access the wordpress loop and breaking down arrays to use them in archives

IMPORTANT
For anyone using the information in this post just be careful not to include the ? in the query string parameter

The query string parameter looked like post_type=venue&p={{dc:post:meta key=“venue”}}

many thanks again for the help

Glad to know that you managed to resolve the issue on your own! Please don’t hesitate to open another thread if you have more questions. Have a nice day.