Hey there,
I have a relationship between two CPTs. Let's say 'hotels' (wp_hotels) and 'units' (wp_units).
On the hotel page, I'd like to show all that information, but also information pulled from the units table and not just the title.
For simplicity, I will use these fields:
table: wp_hotels
field: name
field: city
table: wp_units
field: type
field: date_available
When I do
$connected = new WP_Query( [
'relationship' => [
'id' => 'units_to_hotels',
'from' => get_the_ID(),
],
'nopaging' => true,
] );
I do a printR on $connected, I see the correct units, but not the custom fields.
On my 'hotel' page, I would like to show:
Hotel Name
(city)
Units In Hotel:
(type) - (date_available)
.... essentially, how do I show (type) and (date_available) on the hotel page? Thank you!