Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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.

    #679262

    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

    #680636

    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.

    #682024

    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

    #682069

    Hi Josue,

    Thanks for your response!
    The names are now linked, BUT the links are empty.

    Cheers, T.

    #682080

    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.

    #682134

    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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Link to author’ is closed to new replies.