• Resolved tampax

    (@tampax)


    I can’t understand. I want the link to lead to the author’s profile. site.com/author/username. I try to write user_id but it doesn’t help. Can you give me a hint? Thanks!

    
    <?php foreach ( $leaders as $id => $leader ) :
    						$html   = ! empty( $leader->comment_author_url ) ? 'a href="' . $leader->user_id . '" target="_blank"' : 'p';
    						$html_c = ! empty( $leader->comment_author_url ) ? 'a' : 'p';
    					?>
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author kolakube

    (@alexmangini)

    Hey @tampax, it looks like the query doesn’t return the user ID in from the $leaders object so you can do a user lookup by email to get the user ID and other information:

    $user = get_user_by( 'email', $leader->comment_author_email );
    $user_id = $user->ID;
    
    Thread Starter tampax

    (@tampax)

    it really works. Thanks!??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I want the link to lead to the author’s profile’ is closed to new replies.