• superuntitled

    (@superuntitled)


    Hello, I am working in the comments loop and would like to link to the comment author’s “author template page” (ie https://yoursite.com/author/registeredCommenterName), not the page linked to with comment_author_link(). If the commenter does not have an account, only their name would be displayed (no link).

    Is this possible? any help would be appreciated.

    (note: I am not afraid of mySql queries or php functions).

    thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter superuntitled

    (@superuntitled)

    I figured it out.

    <?php
    $aid = $comment->user_id;
    $urlHome =get_bloginfo('template_directory');
    	if($aid !=  '0'){
    	echo "<a href='https://yworlds.com/portal/?author=$aid'>";
    	echo get_avatar( $aid, 70,  $default = $urlHome . '/images/navitar.jpg' );
    	echo "</a>";
    	}
    	else echo get_avatar( $aid, 70,  $default = $urlHome . '/images/navitar.jpg' );
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘In wordPress comment loop: link to author template page’ is closed to new replies.