No really but thanks for your response, always appreciated.
What I’m trying to do is pre-populate the relationship field so that on the front-end form of the quotes page, it already has the pre-job page connected to it, so that the user doesn’t have to search and click the wrong one by mistake.
I’ve used the following:
<?php
$job_client_connect = get_posts(array(
'post_type' => 'people',
'meta_query' => array(
array(
'key' => 'job_client', // name of custom field
'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"
'compare' => 'LIKE'
)
)
));
?>
<?php if( $job_client_connect ): ?>
<table>
<?php foreach( $job_client_connect as $job_client_connect ):?>
<tr>
<td>
<a href="<?php echo get_permalink( $job_client_connect->ID ); ?>">
<?php echo get_the_title( $job_client_connect->ID ); ?>
</a>
<p><?php echo get_field('employer', $job_client_connect->ID ); ?></p>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
Displays the name & permalink, still not getting the employer ACF info though. It just prints Array below
Thanks, I’ve tried your plugin and added a relationship of the same name on the people custom post type.
Do you have any documentation on how to display the info?