Hi There,
On mention homepage we would like to link the authors to the corresponding author page.
How can we achieve that?
Thanks, T.
Hey elbnetz!
Thank you for using Enfold.
How did you add the author markup? You can add either of the following functions:
https://codex.wordpress.org/Function_Reference/get_the_author_link
https://codex.wordpress.org/Function_Reference/the_author_link
Regards,
Ismael
Hi There,
Thanks for your answer. Unfortunately it doesn’t help, as we are not coders. Could you specify a little more what we need to do?
We already copied the postslider.php into our child theme. We think the important part is the following:
$author_id = $entry->post_author;
$author_name = get_the_author_meta( 'display_name' , $author_id );
$meta .= ' von '.$author_name;
$meta .= "</div>";
What do we need to do exactly to get linked names instead of just the names?
Thanks, T.
Hey!
Try this:
$author_id = $entry->post_author;
$author_name = get_the_author_meta( 'display_name' , $author_id );
$author_link = get_the_author_meta( 'user_url' , $author_id );
$meta .= ' von <a href="'.$author_link.'">'.$author_name.'</a>';
$meta .= "</div>";
Cheers!
Josue
Hi Josue,
Thanks for your response!
The names are now linked, BUT the links are empty.
Cheers, T.
We’ve found the solution:
$author_id = $entry->post_author;
$author_name = get_the_author_meta( 'display_name' , $author_id );
$author_link = get_author_posts_url($author_id);
$meta .= ' von <a href="'.$author_link.'">'.$author_name.'</a>';
$meta .= "</div>";
Thanks for leading in the right direction!
Cheers, T.
Hi!
Thanks a lot for letting us know but also for posting the solution here.
Let us know if we can do anything else for you, we would be happy to assist you.
Best regards,
Basilis