-
AuthorPosts
-
August 26, 2016 at 9:51 am #678029
Hi There,
On mention homepage we would like to link the authors to the corresponding author page.
How can we achieve that?Thanks, T.
August 30, 2016 at 5:21 am #679262Hey 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_linkRegards,
IsmaelSeptember 1, 2016 at 11:29 am #680636Hi 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.
September 5, 2016 at 9:03 am #682024Hey!
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!
JosueSeptember 5, 2016 at 11:10 am #682069Hi Josue,
Thanks for your response!
The names are now linked, BUT the links are empty.Cheers, T.
September 5, 2016 at 11:44 am #682080We’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.
September 5, 2016 at 1:35 pm #682134Hi!
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 -
AuthorPosts
- The topic ‘Link to author’ is closed to new replies.
