Hello,
I have an “editor” (another author) field that I created with relation user. I can get it to work with this code:
<?php
$array = get_field(‘editor’);
print_r($array[‘display_name’]);
?>
It shows the editor of the post. But I want it to link to the author post url of the editor, not the actual author of the post. How can I can do that?
EDIT: I tried this but it gives me the link of the actual author:
<a href=”
<?php $array = get_field(‘editor’);
echo get_author_posts_url( get_the_author_meta( ‘ID’ ) );
?>”>
<?php $users = get_field(‘editor’);
print_r($array[‘display_name’]);
?>
Ok, I solved it:
<a href=”
<?php $array = get_field(‘editor’);
echo get_author_posts_url($array[‘ID’]);
?>”>
<?php $users = get_field(‘editor’);
print_r($array[‘display_name’]);
?>