-
AuthorPosts
-
January 24, 2018 at 12:27 am #901766
Hi,
how can I make the author comments link to the about-me-page (single blog!) instead of the author archive page,
when someone clicks on the author comment name in the comment list below a post?I thought that this snippet would resolve it, but it has no effect at all:
https://codex.wordpress.org/Plugin_API/Filter_Reference/author_linkadd_filter( 'author_link', 'modify_author_link', 10, 1 ); function modify_author_link( $link ) { $link = 'http://example.com/'; return $link; }
Thanks.
January 24, 2018 at 3:56 am #901855Hey Chris,
I tested this on my localhost at the bottom of my functions.php and it worked for me. See screenshot
I assume you changed the “http://example.com/” link to your profile page.Best regards,
Mike- This reply was modified 6 years, 10 months ago by Mike.
January 24, 2018 at 2:05 pm #902137Hi Mike,
I don’t mean the author name below a post, I mean the author name & image/gravatar in the comment list!
I had marked it strong in my post.January 24, 2018 at 2:42 pm #902153Hi,
In my clean install the author name & gravatar in the comment list don’t have link tags so they are not links, do yours? Please include the url to the page in question so we can take a closer look.
If yours is the same as this, and you would like this function you can edit the includes/loop-comments.php to include the links.Best regards,
MikeJanuary 24, 2018 at 4:22 pm #902210okay, again: how can I make the author COMMENTS in the COMMENT LIST linkable to the author archive OR to the ABOUT ME page?
Example – see comment list:
and YES, I have add an website url (my about page) in the user/admin profile!
(my site is not yet online, so please see the demo link above)- This reply was modified 6 years, 9 months ago by BeeCee.
January 29, 2018 at 11:22 am #904165Hi,
Do you want the whole comment to be a link to the author page? Please edit the includes > loop-commment.php file. Look for this code around line 49.
<?php comment_text(); ?>
Best regards,
IsmaelJanuary 29, 2018 at 11:30 am #904166thanks, no, only the author name and its avatar should link to the “auther page” and – better – to my own “about-me” page, because I run a single-author-blog.
January 30, 2018 at 4:57 am #904613Hi,
Alright. Please edit the said file then look for this code.
echo get_avatar($comment,'60', '', $gravatar_alt); ?>
Replace it with:
echo '<a rel="nofollow" href="'.$link.'" >'; echo get_avatar($comment,'60', '', $gravatar_alt); echo '</a'; ?>
Please take note of the php closing tag.
Best regards,
IsmaelJanuary 31, 2018 at 10:27 pm #905849thanks, is working fine! Appreciate your help very much!
February 1, 2018 at 12:44 am #905925 -
AuthorPosts
- The topic ‘Author comments: how to redirect author name to about-me-page instead of archive’ is closed to new replies.