Look in your theme’s comments.php for “wp_list_comments”.
If it looks like this:
wp_list_comments();
Then change it to this:
wp_list_comments(array(
'login_text' => 'Login and then you can reply, buddy!',
));
If it already has an array of stuff on it, or some other string, then add the login_text parameter to that array or string.
Brillant, thanks Otto ….
Here’s what I have:
wp_list_comments('type=comment&callback=sdac_comment');
What’s that junk in there? I think it’s coming from something custom in the theme, but I can’t figure out why… the extra problem is that I don’t only want to change the text – what I’d also like is to add a second option, ie:
“login here …. or click this to register if you’re new”
Changing the text is easy. Example:
wp_list_comments('type=comment&callback=sdac_comment&login_text=EXAMPLE');
Adding new functionality is more difficult.
Look throughout your theme for the sdac_comment function. In there, there will be a call to “comment_reply_link”. That function call is what prints the reply link (using the text from the login_text parameter), so if you want to add something else there that is not a reply link, like a link to the register page, then you can add the code before or after that function call.
Thanks! Man, this is frying my brain… so… if you still have a second. Here’s the whole function, as far as I can tell:
function sdac_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>" class="completeComment">
<div class="gravatar">
<?php if (function_exists('get_avatar') && get_option('show_avatars')) { echo get_avatar($comment, 32); } ?>
</div>
<div class="commentBox">
<p class="commentMeta"><?php comment_time('F d, Y');?> at <?php comment_time('G:i a T');?> | <?php comment_author_link();?> writes:</p>
<?php if ($comment->comment_approved == '0') : ?>
<p><?php _e('Your comment is awaiting moderation.') ?></p>
<?php endif; ?>
<?php comment_text(); ?>
<p class="reply"> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> <?php edit_comment_link();?></p>
</div>
</div>
</li>
<?php
}
I’m still totaly baffled as to where that wording is coming from? I see the “reply” part… but there’s nothing there that would seem to me to produce that text….I guess I could hard-code something in right?
Ha! I got it! I just did this:
<p class="reply"> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> Or <a href="LINK TO REGISTRATION">REGISTER HERE</a> if you are new.<?php edit_comment_link();?></p>
I reckon, however, that’s a pretty ugly hack. Is there any reason I shouldn’t do it this way?
No, that is the correct way, basically. Since the theme is using a custom callback, it’s pretty much the only way.