Hello, I have a relationship field in ‘post’ post type filtered to show the ‘news’ posts.
All I need is display the last post chosen in the relationship field, I don’t have any idea about that, I hope you can help me with that.
// get the relationship field
$posts = get_field('relationship-field-name');
// get the last post in the field
$post = array_pop($posts);