Support » Fixing WordPress » Where to find ‘reply’ on threaded comments?

  • The new threaded comments system is very nice, but I’d like to be able to change the text Reply. Where can I do this, I can’t find it in the code of the comments.php.

Viewing 14 replies - 1 through 14 (of 14 total)
  • It’s not in comments.php, it’s in “single.php” – where the comments template is called in. I don’t know what theme you’re using, but look at that file – you’ll probably see it.

    Not to find there, this is the entire code in single.php (theme Magazine Basic).

    <?php get_header(); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h1><?php the_title(); ?></h1>
    <div class=”entry”>
    <?php the_content(); ?>

    <?php the_tags( ‘<p class=”tags”>Tags: ‘, ‘, ‘, ‘</p>’); ?>

    <p class=”postmetadata alt”>
    Dit bericht is toegevoegd
    op <?php the_time(‘l j F Y’) ?> om <?php the_time() ?> uur. | <?php if(function_exists(‘wp_email’)) { email_link(); } ?>



    <?php comments_template(); ?>

    <?php endwhile; else: ?>

    <p>Sorry, no posts matched your criteria.</p>

    <?php endif; ?>

    <?php get_footer(); ?>

    Oh wait – sorry – you’re right. At least, assuming you mean “Leave a Reply” – which is what the default says. I have no idea what theme you’re using (nor where your site is, so I’m guessing things here) so in the default theme, the message is a link that says “Leave a Reply” and when clicked, it takes you to the comment form. If so, then in the comments.php file, you’re looking for this:

    <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>

    At least, that’s what it is in the default theme. You might look at the files in the default theme and compare them to your files – you’ll probably find the answer better that way than having me (or someone else) guess at how your is set up. but the Default theme pretty much has all the code you need – you can probably pick it apart and find it in there – whatever yours is missing, the default most likely has.

    It’s not the leave a reply message, thats part of the comment-form. It’s, in 2.7 with threaded comments, just the word ‘reply’ (looks like a little button) to let visitors reply to a comment of someone else. I’ve checked almost all php-files and can’t find it.

    My theme is Magazine Basic
    WP 2.7 (still in progress).

    Okay the text is generated by wordpress itself. The code that generates the text is in the functions.php file of you theme. Look for this code.

    <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    You’ll need to change the code to this.

    <?php comment_reply_link(array_merge($args, 'reply_text' => 'EDIT THIS TEXT', array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    Where you change EDIT THIS TEXT to what you want to show up.

    almost there 🙂
    When I copy and paste your suggested line, the blog stops working and the visitor sees a fatal error message.
    When I trim the line to the following:
    <?php comment_reply_link(array_merge($args, ‘Reageren’, array(‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?>

    the site works fine, but I get the following error messaging on a post where someone has entered a comment:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/uitgaan/domains/ on line 676


    Oooohh… I see. Sorry – I really shouldn’t answer on the forums in the morning before I’ve had my 2 cups of coffee 🙂

    You’ve misinterpreted his section: you’ve got

    <?php comment_reply_link(array_merge($args, 'Reageren', array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    your ‘Reageren’ is actually an array – but since you’ve renamed it, it can’t find what it needs. You need to do this:

    <?php comment_reply_link(array_merge($args, 'reply_text' => 'Reageren', array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    Done it, doesnt work. See the errormessage on the site:

    the error message that shows after applying the above, is:

    Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/uitgaan/domains/ on line 676

    Try it this way.

    <?php comment_reply_link(array (‘reply_text’ => ‘Reageren’, ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’])) ?>

    Great, this works. Just one small issue: the button is too small, so the word ‘reageren’ doesn’t fit.
    see this page to see what I mean.

    Can’t find it in the style.css where to edit this (not in the style.css of my theme (Magazine Basic) and not in the default style.css that comes with WordPress.

    It’s in the style.css file under
    ol.commentlist li div.reply you need to change the width to around 60px

    Seems to be all working nicely now.

    I try your code and it worked really good for me. Thanks.

    Webdesign Stuttgart

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Where to find ‘reply’ on threaded comments?’ is closed to new replies.