• Resolved matsim

    (@matsim)


    Hey everyone!

    I’m not much of a coder, and I’m trying to figure out how I can add profile links to comments.

    That is, when it says “Jimmy said” in the comments area I want people to be able to click “Jimmy” as a link and go to his profile page.

    Any ideas?
    Thanks a bunch for your time!

    The code I think I have to deal with is below (using Simplixity theme):

    <div class="commentmetadata">
    <strong><?php comment_author_link() ?></strong>, <?php _e('on'); ?> <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> <?php _e('at');?> <?php comment_time() ?></a> <?php _e('said:'); ?> <?php edit_comment_link('Edit Comment','',''); ?>
     		<?php if ($comment->comment_approved == '0') : ?>
    		<em><?php _e('Your comment is awaiting moderation.'); ?></em>
     		<?php endif; ?>
    </div>

Viewing 7 replies - 1 through 7 (of 7 total)
  • Need more info.

    By Profile did u mean /wp-admin/profile.php? Or Author Page template?

    Thread Starter matsim

    (@matsim)

    wp-admin/profile.php I believe–
    wherever one may view their recent comments.

    Thanks for your interest in this post!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    One option would be to replace

    <?php comment_author_link() ?>

    with

    <a href ="<?php bloginfo('url'); ?>/?author=<?php echo $comment->user_id ?>"><?php echo $comment->comment_author?></a>

    That said, I’m sure there’s a way to do it with a function replacement.

    Also, I wouldn’t point the link to their wp-admin profile, since only you (and they) can see it, defeating any usefulness for the users.

    I’d add in an ‘if admin, show link’ thing instead.

    Yeah, there’s no use for u to point the URL to wp-admin/profile.php. Only logged in user can access that.

    So, I’m guessing Author Page template, where visitor can view all the author post. See Ipstenu reply.

    I still didnt understand the point of wp-admin/profile.php.
    The profile appears nowhere and nobody gets to see the information entered there.

    Please educate me on this as I have been trying to figure out a profile page for WordPress for a while now.

    Thread Starter matsim

    (@matsim)

    Thank you very much Ipstenu and Zeo.

    Yeah, I am looking to forward the visitor to author page. The code provided worked perfectly.

    I still didnt understand the point of wp-admin/profile.php.
    The profile appears nowhere and nobody gets to see the information entered there.

    Please educate me on this as I have been trying to figure out a profile page for WordPress for a while now.

    I’m still experimenting with the author page. Had to create one because my template didn’t include an author.php. Thankfully I found some templates out there and messed with them a little.

    However, I am still stuck with the problem of trying to list an author’s comments on the author’s page.

    Thank you, Ipstenu, this was just what i was looking for.

    thanks a lot 😀

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Link to User Profile in their Comment?’ is closed to new replies.